/** * @param ServiceContainer $container */ private function setupRerunner(ServiceContainer $container) { $container->setShared('process.rerunner', function (ServiceContainer $c) { return new ReRunner\OptionalReRunner($c->get('process.rerunner.platformspecific'), $c->get('console.io')); }); if ($container->isDefined('process.rerunner.platformspecific')) { return; } $container->setShared('process.rerunner.platformspecific', function (ServiceContainer $c) { return new ReRunner\CompositeReRunner($c->getByPrefix('process.rerunner.platformspecific')); }); $container->setShared('process.rerunner.platformspecific.pcntl', function (ServiceContainer $c) { return ReRunner\PcntlReRunner::withExecutionContext($c->get('process.phpexecutablefinder'), $c->get('process.executioncontext')); }); $container->setShared('process.rerunner.platformspecific.passthru', function (ServiceContainer $c) { return ReRunner\PassthruReRunner::withExecutionContext($c->get('process.phpexecutablefinder'), $c->get('process.executioncontext')); }); $container->setShared('process.rerunner.platformspecific.windowspassthru', function (ServiceContainer $c) { return ReRunner\WindowsPassthruReRunner::withExecutionContext($c->get('process.phpexecutablefinder'), $c->get('process.executioncontext')); }); $container->setShared('process.phpexecutablefinder', function () { return new PhpExecutableFinder(); }); }