mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-24 00:55:35 +08:00
fix issue #15 at version 1.6.2
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
"description": "High performance QQ robot and web server development framework",
|
"description": "High performance QQ robot and web server development framework",
|
||||||
"minimum-stability": "stable",
|
"minimum-stability": "stable",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"version": "1.6.1",
|
"version": "1.6.2",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "whale",
|
"name": "whale",
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ $config['static_file_server'] = [
|
|||||||
|
|
||||||
/** 注册 Swoole Server 事件注解的类列表 */
|
/** 注册 Swoole Server 事件注解的类列表 */
|
||||||
$config['server_event_handler_class'] = [
|
$config['server_event_handler_class'] = [
|
||||||
\Framework\ServerEventHandler::class, //默认不可删除,否则会不能使用框架
|
\Framework\ServerEventHandler::class,
|
||||||
];
|
];
|
||||||
|
|
||||||
return $config;
|
return $config;
|
||||||
|
|||||||
@@ -76,7 +76,10 @@ class FrameworkLoader
|
|||||||
self::$argv[] = "--disable-console-input";
|
self::$argv[] = "--disable-console-input";
|
||||||
}
|
}
|
||||||
$this->server->set($settings);
|
$this->server->set($settings);
|
||||||
$all_event_class = self::$settings->get("server_event_handler_class");
|
$all_event_class = self::$settings->get("server_event_handler_class") ?? [];
|
||||||
|
if (!in_array(ServerEventHandler::class, $all_event_class)) {
|
||||||
|
$all_event_class[] = ServerEventHandler::class;
|
||||||
|
}
|
||||||
$event_list = [];
|
$event_list = [];
|
||||||
foreach ($all_event_class as $v) {
|
foreach ($all_event_class as $v) {
|
||||||
$reader = new AnnotationReader();
|
$reader = new AnnotationReader();
|
||||||
@@ -125,15 +128,6 @@ class FrameworkLoader
|
|||||||
}
|
}
|
||||||
if (in_array("--debug-mode", self::$argv))
|
if (in_array("--debug-mode", self::$argv))
|
||||||
Console::warning("You are in debug mode, do not use in production!");
|
Console::warning("You are in debug mode, do not use in production!");
|
||||||
register_shutdown_function(function() {
|
|
||||||
$error = error_get_last();
|
|
||||||
if(isset($error["type"]) && $error["type"] == 1) {
|
|
||||||
if(mb_strpos($error["message"], "require") !== false && mb_strpos($error["message"], "callback") !== false) {
|
|
||||||
echo "\e[38;5;203mYou may need to update your \"global.php\" config!\n";
|
|
||||||
echo "Please see: https://github.com/zhamao-robot/zhamao-framework/issues/15\e[m\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
$this->server->start();
|
$this->server->start();
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
Console::error("Framework初始化出现错误,请检查!");
|
Console::error("Framework初始化出现错误,请检查!");
|
||||||
@@ -177,7 +171,6 @@ class FrameworkLoader
|
|||||||
//if (!file_exists(CRASH_DIR . "last_error.log")) die("Can not find log file.\n");
|
//if (!file_exists(CRASH_DIR . "last_error.log")) die("Can not find log file.\n");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
global $motd;
|
global $motd;
|
||||||
|
|||||||
Reference in New Issue
Block a user