@@ -11,7 +11,7 @@ |
||
11 | 11 | |
12 | 12 | /** |
13 | 13 | * Bind socket |
14 | - * @return boolean Success. |
|
14 | + * @return null|boolean Success. |
|
15 | 15 | */ |
16 | 16 | public function bind() { |
17 | 17 | $e = explode(':', $this->addr, 4); |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | } |
88 | 88 | /** |
89 | 89 | * Setting default config options |
90 | - * @return array|false |
|
90 | + * @return boolean |
|
91 | 91 | */ |
92 | 92 | protected function getConfigDefaults() { |
93 | 93 | return false; |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | * Bind given sockets |
247 | 247 | * @param mixed Addresses to bind |
248 | 248 | * @param boolean SO_REUSE. Default is true |
249 | - * @return void |
|
249 | + * @return integer |
|
250 | 250 | */ |
251 | 251 | public function bind($addrs = array(), $reuse = true, $max = 0) { |
252 | 252 | if (is_string($addrs)) { |
@@ -314,6 +314,8 @@ discard block |
||
314 | 314 | * @param string Optional. Default port |
315 | 315 | * @param callback Optional. Callback. |
316 | 316 | * @param string Optional. Connection class name. |
317 | + * @param string $addr |
|
318 | + * @param Closure $cb |
|
317 | 319 | * @return integer Connection's ID. Boolean false when failed. |
318 | 320 | */ |
319 | 321 | public function connectTo($addr, $port = 0, $cb = null, $class = null) { |
@@ -82,6 +82,9 @@ discard block |
||
82 | 82 | define("SO_REUSEPORT", 0x200); // FIXME: this is a BSD-only hack |
83 | 83 | } |
84 | 84 | |
85 | + /** |
|
86 | + * @param string $mod |
|
87 | + */ |
|
85 | 88 | public static function loadModuleIfAbsent($mod) { |
86 | 89 | if (extension_loaded($mod)) { |
87 | 90 | return true; |
@@ -249,7 +252,7 @@ discard block |
||
249 | 252 | |
250 | 253 | /** |
251 | 254 | * It allows to run your simple web-apps in spawn-fcgi/php-fpm environment. |
252 | - * @return boolean - Success. |
|
255 | + * @return boolean|null - Success. |
|
253 | 256 | */ |
254 | 257 | public static function compatRunEmul() { |
255 | 258 | Daemon::$dir = realpath(__DIR__ . '/..'); |
@@ -473,7 +476,7 @@ discard block |
||
473 | 476 | |
474 | 477 | /** |
475 | 478 | * spawn new master process. |
476 | - * @return boolean - success |
|
479 | + * @return null|integer - success |
|
477 | 480 | */ |
478 | 481 | public static function spawnMaster() { |
479 | 482 | Daemon::$masters->push($thread = new Daemon_MasterThread); |
@@ -542,6 +545,8 @@ discard block |
||
542 | 545 | |
543 | 546 | /** |
544 | 547 | * Calculates a difference between two dates. |
548 | + * @param integer $date_start |
|
549 | + * @param integer $date_finish |
|
545 | 550 | * @return string Something like this: 1 year. 2 mon. 6 day. 4 hours. 21 min. 10 sec. |
546 | 551 | */ |
547 | 552 | public static function date_period_text($date_start, $date_finish) { |
@@ -499,7 +499,6 @@ |
||
499 | 499 | |
500 | 500 | /** |
501 | 501 | * Parses command-line arguments. |
502 | - * @param array $_SERVER['argv'] |
|
503 | 502 | * @return void |
504 | 503 | */ |
505 | 504 | public static function getArgs($args) { |
@@ -102,6 +102,9 @@ |
||
102 | 102 | } |
103 | 103 | } |
104 | 104 | |
105 | + /** |
|
106 | + * @param string $path |
|
107 | + */ |
|
105 | 108 | public function loadFile($path) { |
106 | 109 | $parser = new Daemon_ConfigParser($path,$this); |
107 | 110 | $this->onLoad(); |
@@ -24,6 +24,9 @@ |
||
24 | 24 | } |
25 | 25 | } |
26 | 26 | |
27 | + /** |
|
28 | + * @param boolean $value |
|
29 | + */ |
|
27 | 30 | public function setValue($value) { |
28 | 31 | $old = $this->value; |
29 | 32 | $this->value = $value; |
@@ -27,6 +27,7 @@ discard block |
||
27 | 27 | |
28 | 28 | /** |
29 | 29 | * Constructor |
30 | + * @param Daemon_Config $config |
|
30 | 31 | * @return void |
31 | 32 | */ |
32 | 33 | public function __construct($file, $config, $included = FALSE) |
@@ -306,6 +307,9 @@ discard block |
||
306 | 307 | * Raises error message. |
307 | 308 | * @param string Message. |
308 | 309 | * @param string Level. |
310 | + * @param string $msg |
|
311 | + * @param integer $line |
|
312 | + * @param integer $col |
|
309 | 313 | * @return void |
310 | 314 | */ |
311 | 315 | public function raiseError($msg, $level = 'emerg', $line = null, $col = null) { |
@@ -324,6 +328,7 @@ discard block |
||
324 | 328 | |
325 | 329 | /** |
326 | 330 | * Executes token-parse callback. |
331 | + * @param string $c |
|
327 | 332 | * @return void |
328 | 333 | */ |
329 | 334 | public function token($token, $c) { |
@@ -132,6 +132,7 @@ discard block |
||
132 | 132 | /** |
133 | 133 | * Log something |
134 | 134 | * @param string - Message. |
135 | + * @param string $message |
|
135 | 136 | * @return void |
136 | 137 | */ |
137 | 138 | public function log($message) { |
@@ -162,7 +163,7 @@ discard block |
||
162 | 163 | /** |
163 | 164 | * @todo description? |
164 | 165 | * @param boolean - Hard? If hard, we shouldn't wait for graceful shutdown of the running applications. |
165 | - * @return boolean - Ready? |
|
166 | + * @return boolean|null - Ready? |
|
166 | 167 | */ |
167 | 168 | public function shutdown($hard = FALSE) { |
168 | 169 | $error = error_get_last(); |
@@ -139,6 +139,7 @@ discard block |
||
139 | 139 | /** |
140 | 140 | * Log something |
141 | 141 | * @param string - Message. |
142 | + * @param string $message |
|
142 | 143 | * @return void |
143 | 144 | */ |
144 | 145 | public function log($message) { |
@@ -167,6 +168,7 @@ discard block |
||
167 | 168 | } |
168 | 169 | /** |
169 | 170 | * @todo description missed |
171 | + * @param integer $id |
|
170 | 172 | */ |
171 | 173 | public function reloadWorker($id) { |
172 | 174 | if (isset($this->workers->threads[$id])) { |
@@ -322,6 +324,9 @@ discard block |
||
322 | 324 | $this->shutdown(SIGINT); |
323 | 325 | } |
324 | 326 | |
327 | + /** |
|
328 | + * @param integer $signo |
|
329 | + */ |
|
325 | 330 | public function signalToChildren($signo) { |
326 | 331 | foreach ($this->collections as $col) { |
327 | 332 | $col->signal($signo); |