dev-master
9999999-dev
The Requires
The Development Requires
0.1.1
0.1.1.0
The Requires
The Development Requires
0.1.0
0.1.0.0
The Requires
The Development Requires
Super-simple library for executing shell commands in php. I have created it without knowledge of already mature (fulfiling my needs) library https://github.com/symfony/Process, (*1)
Use composer:, (*2)
{ "require": { "tomaszdurka/php-exec": "~0.1.0" } }
$command = new Command('ls'); $result = $command->run(); $result->isSuccess(); $result->getOutput(); $result->getExitCode(); $result->getErrorOutput();
Apart from basic usage you can listen to intercept specific Command events. All possible events are listed in example below:, (*3)
$command = new Command('ls'); $command->on('start', function($pid) { }); $command->on('stdout', function($output) { }); $command->on('stderr', function($error) { }); $command->on('stop', function($exitCode) { }); $command->run();