mirror of
https://github.com/symfony/recipes-contrib.git
synced 2026-09-12 15:46:52 +03:00
Adding recipe for phpfastcgi/fastcgi-daemon
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user