update to 2.2.10 version

add build-runtime.sh
remove debug msg when stopping
add --show-php-ver argument for server
This commit is contained in:
jerry
2021-03-08 00:48:51 +08:00
parent a23f3d8f16
commit de5744c9e4
6 changed files with 235 additions and 3 deletions

View File

@@ -26,6 +26,7 @@ class RunServerCommand extends Command
new InputOption("disable-coroutine", null, null, "关闭协程Hook"),
new InputOption("daemon", null, null, "以守护进程的方式运行框架"),
new InputOption("watch", null, null, "监听 src/ 目录的文件变化并热更新"),
new InputOption("show-php-ver", null, null, "启动时显示PHP版本"),
new InputOption("env", null, InputOption::VALUE_REQUIRED, "设置环境类型 (production, development, staging)"),
]);
$this->setDescription("Run zhamao-framework | 启动框架");

View File

@@ -110,6 +110,9 @@ class Framework
if (ZMConfig::get("global", "static_file_server")["status"] !== false) {
$out["static_file_server"] = "enabled";
}
if (self::$argv["show-php-ver"] !== false) {
$out["php_version"] = PHP_VERSION;
}
$out["working_dir"] = DataProvider::getWorkingDir();
self::printProps($out, $tty_width, $args["log-theme"] === null);
@@ -290,6 +293,7 @@ class Framework
Console::$theme = $y;
}
break;
case 'show-php-ver':
default:
//Console::info("Calculating ".$x);
//dump($y);

View File

@@ -20,7 +20,7 @@ class ZMUtil
public static function stop() {
if (SpinLock::tryLock("_stop_signal") === false) return;
Console::warning(Console::setColor("Stopping server...", "red"));
Console::trace();
if (Console::getLevel() >= 4) Console::trace();
LightCache::savePersistence();
if (ZMBuf::$terminal !== null)
Event::del(ZMBuf::$terminal);