Make sure we reset services between each request

This commit is contained in:
Nyholm
2018-08-05 16:02:28 +02:00
parent a36f59f50e
commit 2995c05970
2 changed files with 8 additions and 5 deletions
@@ -1,6 +1,6 @@
services:
App\FastCGIKernel:
arguments: ['@App\Kernel']
autowire: true
PHPFastCGI\FastCGIDaemon\Driver\DriverContainer: ~
PHPFastCGI\FastCGIDaemon\Command\DaemonRunCommand:
@@ -3,21 +3,23 @@
namespace App;
use PHPFastCGI\FastCGIDaemon\Http\RequestInterface;
use PHPFastCGI\FastCGIDaemon\KernelInterface;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use PHPFastCGI\FastCGIDaemon\KernelInterface as PHPFastCGIKernel;
use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\HttpKernel\TerminableInterface;
class FastCGIKernel implements KernelInterface
class FastCGIKernel implements PHPFastCGIKernel
{
private $kernel;
public function __construct(HttpKernelInterface $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);
@@ -28,3 +30,4 @@ class FastCGIKernel implements KernelInterface
return $symfonyResponse;
}
}