1: <?php
2:
3: namespace PHPFastCGI\FastCGIDaemon;
4:
5: /**
6: * Objects that implement the DaemonFactoryInterface can be used to create
7: * FastCGI daemons that listen on FCGI_LISTENSOCK_FILENO, a configured stream
8: * socket resource or a TCP host and port.
9: */
10: interface DaemonFactoryInterface
11: {
12: /**
13: * Create a FastCGI daemon listening on FCGI_LISTENSOCK_FILENO.
14: *
15: * @param KernelInterface|callable $kernel The daemon's kernel
16: *
17: * @return DaemonInterface The FastCGI daemon
18: */
19: public function createDaemon($kernel);
20:
21: /**
22: * Create a FastCGI daemon listening on a given address. The default host is
23: * localhost.
24: *
25: * @param KernelInterface|callable $kernel The daemon's kernel
26: * @param int $port The port to bind to
27: * @param string $host The host to bind to
28: *
29: * @return DaemonInterface The FastCGI daemon
30: */
31: public function createTcpDaemon($kernel, $port, $host = 'localhost');
32:
33: /**
34: * Create a FastCGI daemon from a stream socket which is configured for
35: * accepting connections.
36: *
37: * @param KernelInterface|callable $kernel The daemon's kernel
38: * @param resource $socket The socket to accept connections from
39: *
40: * @return DaemonInterface The FastCGI daemon
41: */
42: public function createDaemonFromStreamSocket($kernel, $socket);
43: }
44: