Adding recipe for phpfastcgi/fastcgi-daemon

This commit is contained in:
Nyholm
2018-07-29 22:02:27 -07:00
parent d229171889
commit a270cd9185
4 changed files with 52 additions and 0 deletions
@@ -0,0 +1,9 @@
services:
App\FastCGIKernel:
arguments: ['@App\Kernel']
PHPFastCGI\FastCGIDaemon\Driver\DriverContainer: ~
PHPFastCGI\FastCGIDaemon\Command\DaemonRunCommand:
arguments: ['@App\FastCGIKernel', '@PHPFastCGI\FastCGIDaemon\Driver\DriverContainer', 'fastcgi-daemon:run']
tags:
- { name: console.command }
@@ -0,0 +1,6 @@
{
"copy-from-recipe": {
"config/": "%CONFIG_DIR%/",
"src/": "%SRC_DIR%/"
}
}
@@ -0,0 +1,10 @@
<bg=blue;fg=white> </>
<bg=blue;fg=white> What's next? </>
<bg=blue;fg=white> </>
* <fg=blue>Run</> your application:
1. Configure your web server
2. Execute the <comment>bin/console fastcgi-daemon:run</> command;
3. Browse your application super quickly
* <fg=blue>Read</> the documentation at <comment>https://github.com/PHPFastCGI/FastCGIDaemon</>
@@ -0,0 +1,27 @@
<?php
namespace App;
use PHPFastCGI\FastCGIDaemon\Http\RequestInterface;
use PHPFastCGI\FastCGIDaemon\KernelInterface;
use Symfony\Component\HttpKernel\HttpKernelInterface;
class FastCGIKernel implements KernelInterface
{
private $kernel;
public function __construct(HttpKernelInterface $kernel)
{
$this->kernel = $kernel;
}
public function handleRequest(RequestInterface $request)
{
$symfonyRequest = $request->getHttpFoundationRequest();
$symfonyResponse = $this->kernel->handle($symfonyRequest);
$this->kernel->terminate($symfonyRequest, $symfonyResponse);
return $symfonyResponse;
}
}