jascha030 / process-chain
链式调用 symfony/process 命令。
1.0.1
2023-03-28 08:19 UTC
Requires
- php: ~8.1||~8.2
- illuminate/collections: ^10.4
- phpoption/phpoption: ^1.9
- symfony/console: ^6.2
- symfony/process: ^6.2
Requires (Dev)
- bamarni/composer-bin-plugin: ^1.8
- roave/security-advisories: dev-latest
- symfony/filesystem: ^6.2
- symfony/var-dumper: ^6.2
README
链式调用 symfony/process 命令。
入门
先决条件
- php:
>=8.1 - Composer
^2.3
安装
composer require jascha030/process-chain
用法
<?php use Jascha030\Process\Chain\ProcessChain; use Symfony\Component\Console\Output\ConsoleOutput; // Define the commands to run in the process chain $commands = [ 'echo "Hello"', 'echo "World"', ]; // Create a new instance of the ProcessChain class $processChain = ProcessChain::create( $commands, new ConsoleOutput() ); // Disable output for the processes in the chain $processChain->disableOutput(); // Run the processes in the chain $processChain->mustRun(); // Get the exit codes for the processes in the chain $exitCodes = $processChain->getExitCodes(); // Output the exit codes for each command foreach ($exitCodes as $command => $exitCode) { echo "{$command} exited with code {$exitCode}\n"; }
许可证
此Composer包是开源软件,受MIT许可证许可。