lshepstone/php-proc

PHP proc_* library

Installs: 5 823

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/lshepstone/php-proc

dev-master 2013-01-25 13:21 UTC

This package is not auto-updated.

Last update: 2025-10-11 19:33:33 UTC


README

Basic wrapper for the PHP proc_* functions (blocking, single-thread, limited Windows support).

Build Status

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