update to 2.6.6 (build 434)

This commit is contained in:
crazywhalecc 2022-01-08 16:19:43 +08:00
parent 7f0c97c5b9
commit 34db1626a5
4 changed files with 8 additions and 26 deletions

View File

@ -41,7 +41,8 @@ $config['runtime'] = [
'swoole_server_mode' => SWOOLE_PROCESS,
'middleware_error_policy' => 1,
'reload_delay_time' => 800,
'global_middleware_binding' => []
'global_middleware_binding' => [],
'save_console_log_file' => false, // 改为目标路径,则将 Console 输出的日志保存到文件
];
/** 轻量字符串缓存,默认开启 */

View File

@ -30,8 +30,8 @@ class ConsoleApplication extends Application
{
private static $obj = null;
const VERSION_ID = 433;
const VERSION = "2.6.5";
const VERSION_ID = 434;
const VERSION = "2.6.6";
/**
* @throws InitException
@ -65,28 +65,6 @@ class ConsoleApplication extends Application
define("LOAD_MODE", is_dir(SOURCE_ROOT_DIR . "/src/ZM") ? 0 : 1);
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([
new DaemonStatusCommand(),

View File

@ -118,6 +118,9 @@ class Framework
$args["log-theme"] ?? "default",
($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";
date_default_timezone_set($timezone);

View File

@ -94,7 +94,7 @@ class MySQLStatement implements IteratorAggregate, Statement
return $this->statement->rowCount();
}
public function getIterator()
public function getIterator(): StatementIterator
{
return new StatementIterator($this);
}