/** * Makes a request in another process. * * @param Request $request A Request instance * * @return Response A Response instance * * @throws \RuntimeException When processing returns exit code */ protected function doRequestInProcess($request) { $process = new PhpProcess($this->getScript($request)); $process->run(); if ($process->getExitCode() > 0) { throw new \RuntimeException($process->getErrorOutput()); } return unserialize($process->getOutput()); }