From dcb08c31e00f3922c074a67f8993ab0bf5f798ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Wed, 14 Oct 2020 11:13:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HttpServer/Service/Abstracts/Server.php | 22 +++++++++++----------- System/Abstracts/BaseObject.php | 11 +++++------ 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/HttpServer/Service/Abstracts/Server.php b/HttpServer/Service/Abstracts/Server.php index b41221a4..e2687cdc 100644 --- a/HttpServer/Service/Abstracts/Server.php +++ b/HttpServer/Service/Abstracts/Server.php @@ -49,15 +49,15 @@ trait Server */ public function onHandlerListener() { - $this->on('workerStop', $this->createHandler('workerStop')); - $this->on('workerExit', $this->createHandler('workerExit')); - $this->on('workerStart', $this->createHandler('workerStart')); - $this->on('workerError', $this->createHandler('workerError')); - $this->on('managerStart', $this->createHandler('managerStart')); - $this->on('managerStop', $this->createHandler('managerStop')); - $this->on('pipeMessage', $this->createHandler('pipeMessage')); - $this->on('shutdown', $this->createHandler('shutdown')); - $this->on('start', $this->createHandler('start')); + $this->on('WorkerStop', $this->createHandler('workerStop')); + $this->on('WorkerExit', $this->createHandler('workerExit')); + $this->on('WorkerStart', $this->createHandler('workerStart')); + $this->on('WorkerError', $this->createHandler('workerError')); + $this->on('ManagerStart', $this->createHandler('managerStart')); + $this->on('ManagerStop', $this->createHandler('managerStop')); + $this->on('PipeMessage', $this->createHandler('pipeMessage')); + $this->on('Shutdown', $this->createHandler('shutdown')); + $this->on('Start', $this->createHandler('start')); $this->addTask(); } @@ -70,8 +70,8 @@ trait Server { $settings = $this->setting; if (($taskNumber = $settings['task_worker_num'] ?? 0) > 0) { - $this->on('finish', $this->createHandler('finish')); - $this->on('task', $this->createHandler('task')); + $this->on('Finish', $this->createHandler('finish')); + $this->on('Task', $this->createHandler('task')); } } diff --git a/System/Abstracts/BaseObject.php b/System/Abstracts/BaseObject.php index b9fd8d14..58042da4 100644 --- a/System/Abstracts/BaseObject.php +++ b/System/Abstracts/BaseObject.php @@ -103,7 +103,7 @@ class BaseObject implements Configure /** - * @param string $message + * @param mixed $message * @param string $method * @param string $file * @throws @@ -119,7 +119,7 @@ class BaseObject implements Configure /** - * @param string $message + * @param mixed $message * @param string $method * @param string $file * @throws @@ -134,7 +134,7 @@ class BaseObject implements Configure } /** - * @param string $message + * @param mixed $message * @param string $method * @param string $file * @throws @@ -150,17 +150,16 @@ class BaseObject implements Configure /** - * @param string $message + * @param mixed $message * @param string $method * @param string $file - * @throws */ public function warning($message, string $method = __METHOD__, string $file = __FILE__) { if (!is_string($message)) { $message = print_r($message, true); } - echo "\033[33m[SUCCESS][" . date('Y-m-d H:i:s') . ']: ' . $message . "\033[0m"; + echo "\033[33m[WARNING][" . date('Y-m-d H:i:s') . ']: ' . $message . "\033[0m"; echo PHP_EOL; }