* [refac] remove base path when sending trace information to z-monitor.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user