public function runSubProcessInstaller() { $script = <<<'EOF' <?php $_REQUEST['goto'] = 'SilentInstall'; $_REQUEST['cli'] = 'true'; require('install.php'); EOF; $output = ''; $process = new PhpProcess($script, $this->getPath()); // This will be a long process so we allow up to an hour. $process->setTimeout(3600); try { $process->mustRun(function ($type, $buffer) use(&$output) { $output .= $buffer; }); } catch (ProcessFailedException $e) { throw new InstallerException('The installer sub process failed with the following output:' . PHP_EOL . $e->getMessage()); } return $output; }
/** * Constructor. * * @param string $script * @param JobReportManagerInterface $reportManager */ public function __construct($script, JobReportManagerInterface $reportManager) { $this->process = new PhpProcess($script); $this->process->setTimeout(null); $this->reportManager = $reportManager; }