mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-23 16:45:35 +08:00
update to 2.6.6 (build 434)
This commit is contained in:
@@ -41,7 +41,8 @@ $config['runtime'] = [
|
|||||||
'swoole_server_mode' => SWOOLE_PROCESS,
|
'swoole_server_mode' => SWOOLE_PROCESS,
|
||||||
'middleware_error_policy' => 1,
|
'middleware_error_policy' => 1,
|
||||||
'reload_delay_time' => 800,
|
'reload_delay_time' => 800,
|
||||||
'global_middleware_binding' => []
|
'global_middleware_binding' => [],
|
||||||
|
'save_console_log_file' => false, // 改为目标路径,则将 Console 输出的日志保存到文件
|
||||||
];
|
];
|
||||||
|
|
||||||
/** 轻量字符串缓存,默认开启 */
|
/** 轻量字符串缓存,默认开启 */
|
||||||
|
|||||||
@@ -30,8 +30,8 @@ class ConsoleApplication extends Application
|
|||||||
{
|
{
|
||||||
private static $obj = null;
|
private static $obj = null;
|
||||||
|
|
||||||
const VERSION_ID = 433;
|
const VERSION_ID = 434;
|
||||||
const VERSION = "2.6.5";
|
const VERSION = "2.6.6";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws InitException
|
* @throws InitException
|
||||||
@@ -65,28 +65,6 @@ class ConsoleApplication extends Application
|
|||||||
define("LOAD_MODE", is_dir(SOURCE_ROOT_DIR . "/src/ZM") ? 0 : 1);
|
define("LOAD_MODE", is_dir(SOURCE_ROOT_DIR . "/src/ZM") ? 0 : 1);
|
||||||
define("FRAMEWORK_ROOT_DIR", realpath(__DIR__ . "/../../"));
|
define("FRAMEWORK_ROOT_DIR", realpath(__DIR__ . "/../../"));
|
||||||
}
|
}
|
||||||
if (LOAD_MODE == 0) {
|
|
||||||
$composer = json_decode(file_get_contents(SOURCE_ROOT_DIR . "/composer.json"), true);
|
|
||||||
if (!isset($composer["autoload"]["psr-4"]["Module\\"])) {
|
|
||||||
echo "框架源码模式需要在autoload文件中添加Module目录为自动加载,是否添加?[Y/n] ";
|
|
||||||
$r = strtolower(trim(fgets(STDIN)));
|
|
||||||
if ($r === "" || $r === "y") {
|
|
||||||
$composer["autoload"]["psr-4"]["Module\\"] = "src/Module";
|
|
||||||
$composer["autoload"]["psr-4"]["Custom\\"] = "src/Custom";
|
|
||||||
$r = file_put_contents(WORKING_DIR . "/composer.json", json_encode($composer, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));
|
|
||||||
if ($r !== false) {
|
|
||||||
echo "成功添加!请运行 'composer dump-autoload'\n";
|
|
||||||
exit(0);
|
|
||||||
} else {
|
|
||||||
echo zm_internal_errcode("E00006") . "添加失败!请按任意键继续!";
|
|
||||||
fgets(STDIN);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->addCommands([
|
$this->addCommands([
|
||||||
new DaemonStatusCommand(),
|
new DaemonStatusCommand(),
|
||||||
|
|||||||
@@ -118,6 +118,9 @@ class Framework
|
|||||||
$args["log-theme"] ?? "default",
|
$args["log-theme"] ?? "default",
|
||||||
($o = ZMConfig::get("console_color")) === false ? [] : $o
|
($o = ZMConfig::get("console_color")) === false ? [] : $o
|
||||||
);
|
);
|
||||||
|
if ((ZMConfig::get("global", "runtime")["save_console_log_file"] ?? false) !== false) {
|
||||||
|
Console::setOutputFile(ZMConfig::get("global", "runtime")["save_console_log_file"]);
|
||||||
|
}
|
||||||
|
|
||||||
$timezone = ZMConfig::get("global", "timezone") ?? "Asia/Shanghai";
|
$timezone = ZMConfig::get("global", "timezone") ?? "Asia/Shanghai";
|
||||||
date_default_timezone_set($timezone);
|
date_default_timezone_set($timezone);
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ class MySQLStatement implements IteratorAggregate, Statement
|
|||||||
return $this->statement->rowCount();
|
return $this->statement->rowCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getIterator()
|
public function getIterator(): StatementIterator
|
||||||
{
|
{
|
||||||
return new StatementIterator($this);
|
return new StatementIterator($this);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user