ptachoire / process-builder-chain
Add ability to chain symfony processes
Installs: 3 470
Dependents: 1
Suggesters: 0
Security: 0
Stars: 9
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- symfony/process: ~2.5 || ~3.0 || ~4.0
Requires (Dev)
- phpunit/phpunit: ~5.0
This package is not auto-updated.
Last update: 2024-10-31 22:44:34 UTC
README
Add chain ability to symfony process builder or process
Install
composer install
Usage
use Chain\Chain; $chain = new Chain($process); $chain->add('|', $process); $chain->add('&&', $process); $chain->add('>', $output); // see the Chain\Chain source code for all accepted links $chain->getProcess();
A more verbose API is also available:
use Chain\Chain; $chain = new Chain(new Process('cat')); $chain ->input('input.txt') ->pipe('sort') ->andDo('pwgen') ->output('result.log') ->errors('/dev/null'); // see the Chain\Chain source code for all accepted links $chain->getProcess(); // cat < input.txt | sort && pwgen > result.log 2> /dev/null
Test
phpunit
Credits
Project structure inspired by Negotiation by willdurand.
License
phprocess-builder-chain is released under the MIT License. See the bundled LICENSE file for details.