* [refac] remove base path when sending trace information to z-monitor.

This commit is contained in:
liugang
2025-05-27 16:03:44 +08:00
parent e2bc6a7188
commit f680926a97
2 changed files with 4 additions and 4 deletions
+2 -1
View File
@@ -1868,12 +1868,13 @@ class baseDAO
}
if(empty($profiles)) $profiles = $this->query('SHOW PROFILES')->fetchAll();
$basePath = $this->app->getBasePath();
foreach($profiles as $key => $profile)
{
$profile->Duration = round((float)$profile->Duration, 4);
$profile->Explain = [];
$profile->Error = '';
$profile->Code = dbh::$traces[$key];
$profile->Code = str_replace($basePath, '', dbh::$traces[$key]);
$sql = trim($profile->Query);
if(stripos($sql, 'select') !== 0
+2 -3
View File
@@ -281,9 +281,8 @@ class dbh
$trace = $this->getTrace();
if(empty($trace)) return false;
$basePath = realpath(dirname(__FILE__, 3)) . DS;
$file = $trace['file'];
$line = $trace['line'];
$file = $trace['file'];
$line = $trace['line'];
dbh::$traces[] = "vim +$line $file";