update to build 424 (2.6.0-alpha1)

This commit is contained in:
crazywhalecc
2021-11-02 16:01:24 +08:00
parent 85ef09d43c
commit d3c420ec84
13 changed files with 215 additions and 51 deletions

View File

@@ -21,15 +21,14 @@ use ZM\Command\RunServerCommand;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use ZM\Console\Console;
use ZM\Exception\InitException;
class ConsoleApplication extends Application
{
private static $obj = null;
const VERSION_ID = 423;
const VERSION = "2.5.6";
const VERSION_ID = 424;
const VERSION = "2.6.0";
/**
* @throws InitException
@@ -49,7 +48,8 @@ class ConsoleApplication extends Application
*/
public function initEnv($with_default_cmd = ""): ConsoleApplication {
if (defined("WORKDING_DIR")) throw new InitException();
$this->selfCheck();
_zm_env_check();
define("WORKING_DIR", getcwd());
if (Phar::running() !== "") {
@@ -121,17 +121,4 @@ class ConsoleApplication extends Application
die(zm_internal_errcode("E00005") . "{$e->getMessage()} at {$e->getFile()}({$e->getLine()})");
}
}
/**
* 启动炸毛前要做的环境检查项目
*/
private function selfCheck(): void {
if (!extension_loaded("swoole")) die(zm_internal_errcode("E00001") . "Can not find swoole extension.\n");
if (version_compare(SWOOLE_VERSION, "4.5.0") == -1) die(zm_internal_errcode("E00002") . "You must install swoole version >= 4.5.0 !");
if (version_compare(PHP_VERSION, "7.2") == -1) die(zm_internal_errcode("E00003") . "PHP >= 7.2 required.");
if (version_compare(SWOOLE_VERSION, "4.6.7") < 0 && !extension_loaded("pcntl")) {
Console::error(zm_internal_errcode("E00004") . "Swoole 版本必须不低于 4.6.7 或 PHP 安装加载了 pcntl 扩展!");
die();
}
}
}