增加测试机制;完善DebugMysql日志逻辑;更新debug_log表字段格式;发布新版本

This commit is contained in:
2024-01-03 16:22:01 +08:00
parent 58bb8166c9
commit e6779f4921
14 changed files with 767 additions and 76 deletions

View File

@@ -167,9 +167,9 @@ if (!function_exists('auth')) {
* auth权限验证
* @param $node
* @return bool
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @throws think\db\exception\DataNotFoundException
* @throws think\db\exception\DbException
* @throws think\db\exception\ModelNotFoundException
*/
function auth($node = null)
{
@@ -321,3 +321,31 @@ function app_file_path($file_path)
return $app_file_path;
}
function array_to_table($array_tree, $prefix_key = '')
{
$table = [];
foreach ($array_tree as $key => $value) {
if (is_array($value)) {
$table = array_merge($table, array_to_table($value, $key . '.'));
} else {
$table[] = [
'key' => $prefix_key . $key,
'value' => $value,
];
}
}
return $table;
}
function format_bytes($size, $delimiter = '')
{
$units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB'];
for ($i = 0; $size >= 1024 && $i < 5; $i++) {
$size /= 1024;
}
return round($size, 2) . $delimiter . $units[$i];
}