dev-master
9999999-dev https://github.com/lshepstone/php-procPHP proc_* library
MIT
The Requires
- php >=5.3.0
php command cli process line
Wallogit.com
2017 © Pedro Peláez
PHP proc_* library
Basic wrapper for the PHP proc_* functions (blocking, single-thread, limited Windows support)., (*1)
use \PhpProc\Process;
$process = new Process();
$result = $process
->setCommand("/usr/bin/php -r \"echo getenv('USER');\"");
->setWorkingDirectory(__DIR__);
->setEnvironmentVars(array(
'PATH' => getenv('PATH'),
'SHELL' => getenv('SHELL'),
'USER' => 'developer'))
->execute();
echo 'Status: ' . $result->getStatus() . PHP_EOL;
if ($result->hasErrors()) {
echo 'Errors: ' . $result->getStdErrContents();
} else {
echo 'Output: ' . $result->getStdOutContents();
}
Status: 0 Output: developer
PHP proc_* library
MIT
php command cli process line