php-standard-library/process
Typed, non-blocking PHP API for spawning, monitoring, and controlling child processes. Manage stdin/stdout/stderr streams, retrieve exit codes, and handle timeouts and signals with a clean, reliable interface for long-running and parallel tasks.
Artisan commands, Console kernels).Process facade (if extended) or standalone in services/controllers. Can replace shell_exec() or exec() for safer, structured process management.Bus/Dispatchable) for non-blocking process execution.exec() calls, or only specific workflows (e.g., CLI tools vs. API endpoints)?ProcessFailed) or rollback transactions?proc_open() or Symfony Process.)Artisan::call() or raw exec() in custom commands (e.g., database migrations, deploy scripts).exec() calls in CLI commands with php-standard-library/process for consistency.Bus for async process execution (e.g., ProcessJob class).ProcessServiceProvider, event listeners for process lifecycle).Process facade to unify API calls (e.g., Process::run('command')).Process service class in Laravel’s App\Services namespace.ProcessException class and tie it to Laravel’s exception handler.git pull, docker build).stderr streaming to diagnose process failures in Laravel logs.composer.json to avoid breaking changes.max_execution_time and memory usage (e.g., ini_set() adjustments).| Failure Type | Impact | Mitigation |
|---|---|---|
| Process hangs | Blocked Laravel worker | Set timeouts; use kill() fallback. |
| Command injection | Security breach | Whitelist commands; sanitize inputs. |
| High resource usage | Server instability | Limit process memory/CPU via ulimit. |
| Exit code misinterpretation | Silent failures | Log all exit codes; alert on non-zero. |
Process::run('command')->getOutput()).Process into controllers).php artisan make:command + Process).php artisan make:job ProcessJob).How can I help you explore Laravel packages today?