Updated version

This commit is contained in:
Nyholm
2018-08-05 16:02:47 +02:00
parent 2995c05970
commit afe7b67df9
4 changed files with 0 additions and 0 deletions
@@ -0,0 +1,33 @@
<?php
namespace App;
use PHPFastCGI\FastCGIDaemon\Http\RequestInterface;
use PHPFastCGI\FastCGIDaemon\KernelInterface as PHPFastCGIKernel;
use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\HttpKernel\TerminableInterface;
class FastCGIKernel implements PHPFastCGIKernel
{
private $kernel;
public function __construct(KernelInterface $kernel)
{
$this->kernel = $kernel;
}
public function handleRequest(RequestInterface $request)
{
$this->kernel->boot(); // Or ->reboot()
$symfonyRequest = $request->getHttpFoundationRequest();
$symfonyResponse = $this->kernel->handle($symfonyRequest);
if ($this->kernel instanceof TerminableInterface) {
$this->kernel->terminate($symfonyRequest, $symfonyResponse);
}
return $symfonyResponse;
}
}