From 3bf88449eda681fa38aec56f6ec0e85f344c5db7 Mon Sep 17 00:00:00 2001 From: yf <291323003@qq.com> Date: Thu, 3 Jan 2019 22:34:38 +0800 Subject: [PATCH] fix bug --- bin/easyswoole.php | 20 +++++++++++++++++++- src/Core.php | 2 +- src/SysConst.php | 2 +- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/bin/easyswoole.php b/bin/easyswoole.php index 413b03a3..a35603cf 100644 --- a/bin/easyswoole.php +++ b/bin/easyswoole.php @@ -180,7 +180,25 @@ public static function showHelp() } //创建主服务 \EasySwoole\EasySwoole\Core::getInstance()->createServer(); - Install::showTag('main server', $conf->getConf('MAIN_SERVER.SERVER_TYPE')); + $serverType = $conf->getConf('MAIN_SERVER.SERVER_TYPE'); + switch ($serverType){ + case 1:{ + $serverType = 'SWOOLE_TCP'; + break; + } + case 2:{ + $serverType = 'SWOOLE_WEB'; + break; + } + case 3:{ + $serverType = 'SWOOLE_WEB_SOCKET'; + break; + } + default:{ + $serverType = 'UNKNOWN'; + } + } + Install::showTag('main server', $serverType); Install::showTag('listen address', $conf->getConf('MAIN_SERVER.LISTEN_ADDRESS')); Install::showTag('listen port', $conf->getConf('MAIN_SERVER.PORT')); diff --git a/src/Core.php b/src/Core.php index 0fc0831f..3eebf579 100644 --- a/src/Core.php +++ b/src/Core.php @@ -204,7 +204,7 @@ private function registerErrorHandler() register_shutdown_function($func); } - private function registerDefaultCallBack(\swoole_server $server,string $serverType) + private function registerDefaultCallBack(\swoole_server $server,int $serverType) { //如果主服务仅仅是swoole server,那么设置默认onReceive为全局的onReceive if($serverType === EASYSWOOLE_SERVER){ diff --git a/src/SysConst.php b/src/SysConst.php index 38dbb857..bc785e11 100644 --- a/src/SysConst.php +++ b/src/SysConst.php @@ -11,7 +11,7 @@ class SysConst { - const EASYSWOOLE_VERSION = '3.1.2'; + const EASYSWOOLE_VERSION = '3.1.3'; const ERROR_HANDLER = 'ERROR_HANDLER'; const SHUTDOWN_FUNCTION = 'SHUTDOWN_FUNCTION';