diff --git a/lib/base/dao/dao.class.php b/lib/base/dao/dao.class.php index f13e3d18e1..74b58c4e31 100644 --- a/lib/base/dao/dao.class.php +++ b/lib/base/dao/dao.class.php @@ -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 diff --git a/lib/dbh/dbh.class.php b/lib/dbh/dbh.class.php index 97c01e2231..fac983350e 100644 --- a/lib/dbh/dbh.class.php +++ b/lib/dbh/dbh.class.php @@ -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";