Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
kiss291323003 committed Jan 3, 2019
1 parent cf40290 commit 3bf8844
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
20 changes: 19 additions & 1 deletion bin/easyswoole.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));

Expand Down
2 changes: 1 addition & 1 deletion src/Core.php
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand Down
2 changes: 1 addition & 1 deletion src/SysConst.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down

0 comments on commit 3bf8844

Please sign in to comment.