@@ -35,7 +35,7 @@ |
||
35 | 35 | $this->params[strtoupper($name)] = $value; |
36 | 36 | } |
37 | 37 | |
38 | - $this->stdin = $stdin; |
|
38 | + $this->stdin = $stdin; |
|
39 | 39 | |
40 | 40 | rewind($this->stdin); |
41 | 41 | } |
@@ -31,7 +31,7 @@ |
||
31 | 31 | $socket = fopen('php://fd/'.$fd, 'r'); |
32 | 32 | |
33 | 33 | if (false === $socket) { |
34 | - throw new \RuntimeException('Could not open ' . $fd); |
|
34 | + throw new \RuntimeException('Could not open '.$fd); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | return $this->createDaemonFromStreamSocket($kernel, $options, $socket); |
@@ -46,21 +46,21 @@ discard block |
||
46 | 46 | $this->driverContainer = $driverContainer; |
47 | 47 | $this->daemon = null; |
48 | 48 | |
49 | - $name = $name ?: self::DEFAULT_NAME; |
|
49 | + $name = $name ?: self::DEFAULT_NAME; |
|
50 | 50 | $description = $description ?: self::DEFAULT_DESCRIPTION; |
51 | 51 | |
52 | 52 | parent::__construct($name); |
53 | 53 | |
54 | 54 | $this |
55 | 55 | ->setDescription($description) |
56 | - ->addOption('port', null, InputOption::VALUE_OPTIONAL, 'TCP port to listen on (if not present, daemon will listen on FCGI_LISTENSOCK_FILENO)') |
|
57 | - ->addOption('host', null, InputOption::VALUE_OPTIONAL, 'TCP host to listen on') |
|
58 | - ->addOption('fd', null, InputOption::VALUE_OPTIONAL, 'File descriptor to listen on - defaults to FCGI_LISTENSOCK_FILENO', DaemonInterface::FCGI_LISTENSOCK_FILENO) |
|
56 | + ->addOption('port', null, InputOption::VALUE_OPTIONAL, 'TCP port to listen on (if not present, daemon will listen on FCGI_LISTENSOCK_FILENO)') |
|
57 | + ->addOption('host', null, InputOption::VALUE_OPTIONAL, 'TCP host to listen on') |
|
58 | + ->addOption('fd', null, InputOption::VALUE_OPTIONAL, 'File descriptor to listen on - defaults to FCGI_LISTENSOCK_FILENO', DaemonInterface::FCGI_LISTENSOCK_FILENO) |
|
59 | 59 | ->addOption('request-limit', null, InputOption::VALUE_OPTIONAL, 'The maximum number of requests to handle before shutting down') |
60 | - ->addOption('memory-limit', null, InputOption::VALUE_OPTIONAL, 'The memory limit on the daemon instance before shutting down') |
|
61 | - ->addOption('time-limit', null, InputOption::VALUE_OPTIONAL, 'The time limit on the daemon in seconds before shutting down') |
|
62 | - ->addOption('auto-shutdown', null, InputOption::VALUE_NONE, 'Perform a graceful shutdown after receiving a 5XX HTTP status code') |
|
63 | - ->addOption('driver', null, InputOption::VALUE_OPTIONAL, 'The implementation of the FastCGI protocol to use', 'userland'); |
|
60 | + ->addOption('memory-limit', null, InputOption::VALUE_OPTIONAL, 'The memory limit on the daemon instance before shutting down') |
|
61 | + ->addOption('time-limit', null, InputOption::VALUE_OPTIONAL, 'The time limit on the daemon in seconds before shutting down') |
|
62 | + ->addOption('auto-shutdown', null, InputOption::VALUE_NONE, 'Perform a graceful shutdown after receiving a 5XX HTTP status code') |
|
63 | + ->addOption('driver', null, InputOption::VALUE_OPTIONAL, 'The implementation of the FastCGI protocol to use', 'userland'); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | /** |
@@ -77,8 +77,8 @@ discard block |
||
77 | 77 | $logger = new ConsoleLogger($output); |
78 | 78 | |
79 | 79 | $requestLimit = $input->getOption('request-limit') ?: DaemonOptions::NO_LIMIT; |
80 | - $memoryLimit = $input->getOption('memory-limit') ?: DaemonOptions::NO_LIMIT; |
|
81 | - $timeLimit = $input->getOption('time-limit') ?: DaemonOptions::NO_LIMIT; |
|
80 | + $memoryLimit = $input->getOption('memory-limit') ?: DaemonOptions::NO_LIMIT; |
|
81 | + $timeLimit = $input->getOption('time-limit') ?: DaemonOptions::NO_LIMIT; |
|
82 | 82 | $autoShutdown = $input->getOption('auto-shutdown'); |
83 | 83 | |
84 | 84 | return new DaemonOptions([ |
@@ -135,7 +135,7 @@ |
||
135 | 135 | $readSockets = []; |
136 | 136 | } else { |
137 | 137 | $res = []; |
138 | - foreach($read as $socket) { |
|
138 | + foreach ($read as $socket) { |
|
139 | 139 | $res[array_search($socket, $readSockets)] = $socket; |
140 | 140 | } |
141 | 141 | $readSockets = $res; |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | if ($this->autoShutdown) { |
82 | 82 | foreach ($statusCodes as $statusCode) { |
83 | 83 | if ($statusCode >= 500 && $statusCode < 600) { |
84 | - $this->flagShutdown('Automatic shutdown following status code: ' . $statusCode); |
|
84 | + $this->flagShutdown('Automatic shutdown following status code: '.$statusCode); |
|
85 | 85 | break; |
86 | 86 | } |
87 | 87 | } |
@@ -96,13 +96,13 @@ discard block |
||
96 | 96 | */ |
97 | 97 | private function installSignalHandlers() |
98 | 98 | { |
99 | - declare (ticks = 1); |
|
99 | + declare(ticks=1); |
|
100 | 100 | |
101 | - pcntl_signal(SIGINT, function () { |
|
101 | + pcntl_signal(SIGINT, function() { |
|
102 | 102 | throw new ShutdownException('Daemon shutdown requested (received SIGINT)'); |
103 | 103 | }); |
104 | 104 | |
105 | - pcntl_signal(SIGALRM, function () { |
|
105 | + pcntl_signal(SIGALRM, function() { |
|
106 | 106 | throw new ShutdownException('Daemon time limit reached (received SIGALRM)'); |
107 | 107 | }); |
108 | 108 | } |