Skip to content

Basic wrapper for the PHP proc_* functions (blocking, single-thread only)

Notifications You must be signed in to change notification settings

lshepstone/php-proc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PhpProc

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

About

Basic wrapper for the PHP proc_* functions (blocking, single-thread only)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages