mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-08 11:02:48 +08:00
优化xdebug函数,以兼容更高版本php;
This commit is contained in:
@@ -55,7 +55,21 @@ if (!function_exists('xdebug')) {
|
|||||||
$file = is_null($suffix) ? runtime_path() . 'xdebug/' . date('Ymd') . '.txt' : runtime_path() . 'xdebug/' . date('Ymd') . "_{$suffix}" . '.txt';
|
$file = is_null($suffix) ? runtime_path() . 'xdebug/' . date('Ymd') . '.txt' : runtime_path() . 'xdebug/' . date('Ymd') . "_{$suffix}" . '.txt';
|
||||||
}
|
}
|
||||||
file_put_contents($file, "[" . date('Y-m-d H:i:s') . "] " . "========================= {$type} ===========================" . PHP_EOL, FILE_APPEND);
|
file_put_contents($file, "[" . date('Y-m-d H:i:s') . "] " . "========================= {$type} ===========================" . PHP_EOL, FILE_APPEND);
|
||||||
$str = (is_string($data) ? $data : (is_array($data) || is_object($data)) ? print_r($data, true) : var_export($data, true)) . PHP_EOL;
|
|
||||||
|
$str = '';
|
||||||
|
|
||||||
|
if(is_string($data)){
|
||||||
|
$str = $data;
|
||||||
|
}else{
|
||||||
|
if(is_array($data) || is_object($data)){
|
||||||
|
$str = print_r($data, true);
|
||||||
|
}else{
|
||||||
|
$str = var_export($data, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$str . PHP_EOL;
|
||||||
|
|
||||||
$force ? file_put_contents($file, $str) : file_put_contents($file, $str, FILE_APPEND);
|
$force ? file_put_contents($file, $str) : file_put_contents($file, $str, FILE_APPEND);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user