mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-21 15:45:36 +08:00
Add private-mode option for server command
This commit is contained in:
@@ -47,6 +47,7 @@ class RunServerCommand extends Command
|
||||
new InputOption('force-load-module', null, InputOption::VALUE_OPTIONAL, '强制打包状态下加载模块(使用英文逗号分割多个)'),
|
||||
new InputOption('polling-watch', null, null, '强制启用轮询模式监听'),
|
||||
new InputOption('no-state-check', null, null, '关闭启动前框架运行状态检查'),
|
||||
new InputOption('private-mode', null, null, '启动时隐藏MOTD和敏感信息'),
|
||||
]);
|
||||
$this->setDescription('Run zhamao-framework | 启动框架');
|
||||
$this->setHelp('直接运行可以启动');
|
||||
|
||||
@@ -144,9 +144,9 @@ class Framework
|
||||
$this->server_set['log_level'] = SWOOLE_LOG_DEBUG;
|
||||
$add_port = ZMConfig::get('global', 'remote_terminal')['status'] ?? false;
|
||||
|
||||
// if ($instant_mode) {
|
||||
$this->loadServerEvents();
|
||||
// }
|
||||
if (!$instant_mode) {
|
||||
$this->loadServerEvents();
|
||||
}
|
||||
|
||||
$this->parseCliArgs(self::$argv, $add_port);
|
||||
|
||||
@@ -205,7 +205,9 @@ class Framework
|
||||
$out['terminal'] = $conf['host'] . ':' . $conf['port'];
|
||||
}
|
||||
|
||||
self::printProps($out, $tty_width, $args['log-theme'] === null);
|
||||
if (!self::$argv['private-mode']) {
|
||||
self::printProps($out, $tty_width, $args['log-theme'] === null);
|
||||
}
|
||||
if ($args['preview'] ?? false) {
|
||||
exit();
|
||||
}
|
||||
@@ -294,7 +296,9 @@ class Framework
|
||||
|
||||
self::$server->set($this->server_set);
|
||||
Console::setServer(self::$server);
|
||||
self::printMotd($tty_width);
|
||||
if (!self::$argv['private-mode']) {
|
||||
self::printMotd($tty_width);
|
||||
}
|
||||
|
||||
global $asd;
|
||||
$asd = get_included_files();
|
||||
|
||||
Reference in New Issue
Block a user