PhpSubprocess example

use Symfony\Component\Process\PhpSubprocess;
use Symfony\Component\Process\Process;

require is_file(\dirname(__DIR__).'/vendor/autoload.php') ? \dirname(__DIR__).'/vendor/autoload.php' : \dirname(__DIR__, 5).'/vendor/autoload.php';

['e' => $php, 'p' => $process] = getopt('e:p:') + ['e' => 'php', 'p' => 'Process'];

if ('Process' === $process) {
    $p = new Process([$php, __DIR__.'/Fixtures/memory.php']);
} else {
    $p = new PhpSubprocess([__DIR__.'/Fixtures/memory.php'], null, null, 60, [$php]);
}

$p->mustRun();
echo $p->getOutput();
Home | Imprint | This part of the site doesn't use cookies.