draw/process
draw/process is a Laravel/PHP package for running and managing external processes. It helps you start commands, capture output, handle errors, and control execution in a clean API—useful for queues, build tasks, and integrations that need shell tools.
Process component, which is already deeply integrated into Laravel (via illuminate/process and Artisan). This ensures low architectural friction and leverages existing Laravel patterns (e.g., service providers, facades).ffmpeg).curl → parse → transform → store).
Misalignment: Avoid for I/O-bound tasks (use Guzzle) or enterprise workflows (use Symfony Process directly or tools like ReactPHP).6.x. Verify the package supports this version; if not, create a shim layer or fork the package.Process facade (illuminate/process). Example: Does the package override Process::run() or introduce breaking changes?monolog integration for process output).queue:work process cleanup).composer.json and monitor for updates.Str::of($command)->contains(';')).Process::terminate() and implement a watchdog for long-running processes.Process or symfony/process cannot?
Process implementations?
ProcessServiceProvider or Process facade bindings.SIGTERM), cross-platform paths (/tmp vs. C:\temp).spatie/process, laravel/excel (for background processes), or Symfony Process directly.Process or Symfony Process?symfony/process).ProcessServiceProvider or create a new one:
// config/app.php
'providers' => [
Draw\Process\ProcessServiceProvider::class,
],
$this->app->bind(\Draw\Process\Decorators\TimeoutDecorator::class, function ($app) {
return new TimeoutDecorator(60); // 60-second timeout
});
Process::customMethod()) to maintain Laravel conventions.use Draw\Process\Facades\Process;
Process::run(['git', 'status'])->then(function ($output) {
// Handle output
});
Process:
vendor/bin) if experimental.class LaravelProcessWrapper {
public function run(string $command) {
$process = new \Draw\Process\Process(explode(' ', $command));
$process->run();
return $process->getOutput();
}
}
6.x. If the package targets 5.x, create a shim layer:
class ProcessShim extends \Symfony\Component\Process\Process {
public function __construct(array $command, string $cwd = null, array $env = null) {
parent::__construct($command, $cwd, $env);
// Add custom logic here
}
}
/tmp vs. %TEMP%).spatie/process (process management).laravel/queue (async process execution).nunomaduro/collision (command-line tools).Process.Process calls where the package adds value.composer.json:
"require": {
"draw/process": "^1.0.0"
}
composer test:process-compatibility
ps aux | grep <process_id>).How can I help you explore Laravel packages today?