From beaf7be606990efcbce63796e221f72b5927d556 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Wed, 6 Oct 2021 18:01:40 +0800 Subject: [PATCH] update to version 2.5.5 (buid 422) --- composer.json | 2 +- config/global.php | 15 --------------- docs/update/v2.md | 7 +++++++ src/ZM/ConsoleApplication.php | 4 ++-- src/ZM/Framework.php | 2 +- src/ZM/Utils/ZMUtil.php | 2 +- 6 files changed, 12 insertions(+), 20 deletions(-) diff --git a/composer.json b/composer.json index 0cbf495a..c5f3e6d7 100644 --- a/composer.json +++ b/composer.json @@ -35,7 +35,7 @@ "jelix/version": "^2.0", "league/climate": "^3.6", "psy/psysh": "@stable", - "doctrine/orm": "^2.9" + "doctrine/dbal": "^2.13.1" }, "suggest": { "ext-ctype": "Use C/C++ extension instead of polyfill will be more efficient", diff --git a/config/global.php b/config/global.php index f628d252..355fd0c3 100644 --- a/config/global.php +++ b/config/global.php @@ -57,21 +57,6 @@ $config['worker_cache'] = [ 'transaction_timeout' => 30000 ]; -/** @deprecated 放弃使用,旧版数据库,请使用 mysql_config 和 doctrine/dbal 搭配使用 */ -$config['sql_config'] = [ - 'sql_host' => '', - 'sql_port' => 3306, - 'sql_username' => 'name', - 'sql_database' => 'db_name', - 'sql_password' => '', - 'sql_options' => [ - PDO::ATTR_STRINGIFY_FETCHES => false, - PDO::ATTR_EMULATE_PREPARES => false - ], - 'sql_no_exception' => false, - 'sql_default_fetch_mode' => PDO::FETCH_ASSOC //added in 1.5.6 -]; - /** MySQL数据库连接信息,host留空则启动时不创建sql连接池 */ $config['mysql_config'] = [ 'host' => '', diff --git a/docs/update/v2.md b/docs/update/v2.md index 48a56127..f494a74a 100644 --- a/docs/update/v2.md +++ b/docs/update/v2.md @@ -1,5 +1,12 @@ # 更新日志(v2 版本) +## v2.5.5 (build 422) + +> 更新时间:2021.10.6 + +- 修复 `script_` 前缀无法被排除加载模块的 bug +- 修复 MySQL 组件的依赖问题 + ## v2.5.4 (buidl 421) > 更新时间:2021.9.11 diff --git a/src/ZM/ConsoleApplication.php b/src/ZM/ConsoleApplication.php index ed976eec..6c6fe135 100644 --- a/src/ZM/ConsoleApplication.php +++ b/src/ZM/ConsoleApplication.php @@ -28,8 +28,8 @@ class ConsoleApplication extends Application { private static $obj = null; - const VERSION_ID = 421; - const VERSION = "2.5.4"; + const VERSION_ID = 422; + const VERSION = "2.5.5"; /** * @throws InitException diff --git a/src/ZM/Framework.php b/src/ZM/Framework.php index 2f8a8e81..fb26967e 100644 --- a/src/ZM/Framework.php +++ b/src/ZM/Framework.php @@ -156,7 +156,7 @@ class Framework if (isset($this->server_set["task_worker_num"])) { $out["task_worker"] = $this->server_set["task_worker_num"]; } - if (ZMConfig::get("global", "sql_config")["sql_host"] !== "") { + if ((ZMConfig::get("global", "sql_config")["sql_host"] ?? "") !== "") { $conf = ZMConfig::get("global", "sql_config"); $out["mysql_pool"] = $conf["sql_database"] . "@" . $conf["sql_host"] . ":" . $conf["sql_port"]; } diff --git a/src/ZM/Utils/ZMUtil.php b/src/ZM/Utils/ZMUtil.php index c7634dc6..71467519 100644 --- a/src/ZM/Utils/ZMUtil.php +++ b/src/ZM/Utils/ZMUtil.php @@ -86,7 +86,7 @@ class ZMUtil if (($pathinfo['extension'] ?? '') == 'php') { if ($rule === null) { //规则未设置回调时候,使用默认的识别过滤规则 if (substr(file_get_contents($dir . '/' . $v), 6, 6) == '#plain') continue; - elseif (mb_substr($v, 0, 7) == 'global_' || mb_substr($v, 0, 7) == 'script_') continue; + elseif (mb_substr($pathinfo["basename"], 0, 7) == 'global_' || mb_substr($pathinfo["basename"], 0, 7) == 'script_') continue; foreach (($composer['autoload']['files'] ?? []) as $fi) { if (md5_file(DataProvider::getSourceRootDir().'/'.$fi) == md5_file($dir.'/'.$v)) continue 2; }