mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-10 20:44:28 +09:00
Do not get backtrace if query logging is disabled
This commit is contained in:
parent
1e69d7404a
commit
fe54e83379
1 changed files with 21 additions and 12 deletions
|
|
@ -366,8 +366,9 @@ class DB
|
||||||
$log['time'] = date('Y-m-d H:i:s');
|
$log['time'] = date('Y-m-d H:i:s');
|
||||||
$log['backtrace'] = array();
|
$log['backtrace'] = array();
|
||||||
|
|
||||||
$bt = version_compare(PHP_VERSION, '5.3.6', '>=') ? debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS) : debug_backtrace();
|
if (config('debug.enabled') && config('debug.log_queries'))
|
||||||
|
{
|
||||||
|
$bt = defined('DEBUG_BACKTRACE_IGNORE_ARGS') ? debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS) : debug_backtrace();
|
||||||
foreach($bt as $no => $call)
|
foreach($bt as $no => $call)
|
||||||
{
|
{
|
||||||
if($call['function'] == 'executeQuery' || $call['function'] == 'executeQueryArray')
|
if($call['function'] == 'executeQuery' || $call['function'] == 'executeQueryArray')
|
||||||
|
|
@ -382,6 +383,12 @@ class DB
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$log['called_file'] = $log['called_line'] = $log['called_method'] = null;
|
||||||
|
$log['backtrace'] = array();
|
||||||
|
}
|
||||||
|
|
||||||
// leave error log if an error occured
|
// leave error log if an error occured
|
||||||
if($this->isError())
|
if($this->isError())
|
||||||
|
|
@ -393,6 +400,8 @@ class DB
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$log['result'] = 'success';
|
$log['result'] = 'success';
|
||||||
|
$log['errno'] = null;
|
||||||
|
$log['errstr'] = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->setQueryLog($log);
|
$this->setQueryLog($log);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue