Overview

Namespaces

  • PHPFastCGI
    • FastCGIDaemon
      • Command
      • Connection
      • ConnectionHandler
      • Exception
      • Http

Classes

  • PHPFastCGI\FastCGIDaemon\ApplicationFactory
  • PHPFastCGI\FastCGIDaemon\CallbackWrapper
  • PHPFastCGI\FastCGIDaemon\Command\DaemonRunCommand
  • PHPFastCGI\FastCGIDaemon\Connection\StreamSocketConnection
  • PHPFastCGI\FastCGIDaemon\Connection\StreamSocketConnectionPool
  • PHPFastCGI\FastCGIDaemon\ConnectionHandler\ConnectionHandler
  • PHPFastCGI\FastCGIDaemon\ConnectionHandler\ConnectionHandlerFactory
  • PHPFastCGI\FastCGIDaemon\Daemon
  • PHPFastCGI\FastCGIDaemon\DaemonFactory
  • PHPFastCGI\FastCGIDaemon\Http\Request

Interfaces

  • PHPFastCGI\FastCGIDaemon\ApplicationFactoryInterface
  • PHPFastCGI\FastCGIDaemon\Connection\ConnectionInterface
  • PHPFastCGI\FastCGIDaemon\Connection\ConnectionPoolInterface
  • PHPFastCGI\FastCGIDaemon\ConnectionHandler\ConnectionHandlerFactoryInterface
  • PHPFastCGI\FastCGIDaemon\ConnectionHandler\ConnectionHandlerInterface
  • PHPFastCGI\FastCGIDaemon\DaemonFactoryInterface
  • PHPFastCGI\FastCGIDaemon\DaemonInterface
  • PHPFastCGI\FastCGIDaemon\Http\RequestInterface
  • PHPFastCGI\FastCGIDaemon\KernelInterface

Exceptions

  • PHPFastCGI\FastCGIDaemon\Exception\ConnectionException
  • PHPFastCGI\FastCGIDaemon\Exception\DaemonException
  • PHPFastCGI\FastCGIDaemon\Exception\ProtocolException
  • PHPFastCGI\FastCGIDaemon\Exception\ShutdownException
  • Overview
  • Namespace
  • Class
 1: <?php
 2: 
 3: namespace PHPFastCGI\FastCGIDaemon\ConnectionHandler;
 4: 
 5: use PHPFastCGI\FastCGIDaemon\Connection\ConnectionInterface;
 6: use PHPFastCGI\FastCGIDaemon\CallbackWrapper;
 7: use PHPFastCGI\FastCGIDaemon\KernelInterface;
 8: use Psr\Log\LoggerAwareInterface;
 9: use Psr\Log\LoggerAwareTrait;
10: use Psr\Log\LoggerInterface;
11: use Psr\Log\NullLogger;
12: 
13: /**
14:  * The default implementation of the ConnectionHandlerFactoryInterface.
15:  */
16: class ConnectionHandlerFactory implements ConnectionHandlerFactoryInterface, LoggerAwareInterface
17: {
18:     use LoggerAwareTrait;
19: 
20:     /**
21:      * @var KernelInterface
22:      */
23:     private $kernel;
24: 
25:     /**
26:      * Constructor.
27:      *
28:      * @param KernelInterface|callable $kernel The kernel to create handlers for
29:      * @param LoggerInterface          $logger A logger to use
30:      */
31:     public function __construct($kernel, LoggerInterface $logger = null)
32:     {
33:         $this->setLogger((null === $logger) ? new NullLogger() : $logger);
34: 
35:         if ($kernel instanceof KernelInterface) {
36:             $this->kernel = $kernel;
37:         } else {
38:             $this->kernel = new CallbackWrapper($kernel);
39:         }
40:     }
41: 
42:     /**
43:      * {@inheritdoc}
44:      */
45:     public function createConnectionHandler(ConnectionInterface $connection)
46:     {
47:         return new ConnectionHandler($this->kernel, $connection, $this->logger);
48:     }
49: }
50: 
API documentation generated by ApiGen