protected function request(Code $code)
{
$file = $this->createTemporaryFile();
$this->logger->info(sprintf('FastCGI: Dumped code to file: %s', $file));
try {
$code->writeTo($file);
$environment = array('REQUEST_METHOD' => 'POST', 'REQUEST_URI' => '/', 'SCRIPT_FILENAME' => $file);
$response = $this->client->request($environment, '');
$this->logger->debug(sprintf('FastCGI: Response: %s', json_encode($response)));
@unlink($file);
return $response;
} catch (\Exception $e) {
@unlink($file);
throw new \RuntimeException(sprintf('FastCGI error: %s (%s)', $e->getMessage(), $this->host), $e->getCode(), $e);
}
}