protected function logQuery($sql, $queryResponse, $microtimeStart)
{
static $doLog;
if ($doLog === null) {
$doLog = $this->context->getConf()->debug->dbLogQueries;
}
if ($doLog) {
$microtimeEnd = microtime(true);
$backtrace = debug_backtrace(false);
// 0:logQuery > 1:doQuery -> 2:(some Database method) -> 3:callee
$backtrace = $backtrace[3];
$backtrace = ($backtrace['class'] ? "{$backtrace['class']}::" : $backtrace['class']) . $backtrace['function'];
$this->rawQueryHistory[] = array('sql' => $sql, 'caller' => $backtrace, 'numRows' => is_resource($queryResponse) ? $this->getNumRows($queryResponse) : null, 'insertId' => $this->getInsertId(), 'affectedRows' => $this->getAffectedRows(), 'queryTime' => $microtimeEnd - $microtimeStart);
}
return $doLog;
}