$TYPO3_CONF_VARS[‘SYS’][‘sqlDebug’] = ‘2’; // Modified or inserted by TYPO3 Install Tool.
Extenstion: cc_debug 让显示效果更好点
系统自带的无execution time, 可修改t3lib/class.t3lib_db.php实现
function sql_query($query) {
//edit by bobo
$querytime_before = array_sum(explode(' ', microtime()));
$res = mysql_query($query, $this->link);
$querytime_after = array_sum(explode(' ', microtime()));
if ($this->debugOutput) {
$this->debug('sql_query', $query, $querytime_after - $querytime_before);
}
return $res;
}
function debug($func, $query = '', $executiontime=0) {
$error = $this->sql_error();
if ($error || (int)$this->debugOutput === 2) {
debug(
array(
'caller' => 't3lib_DB::' . $func,
'ERROR' => $error,
'lastBuiltQuery' => ($query ? $query : $this->debug_lastBuiltQuery),
'debug_backtrace' => t3lib_utility_Debug::debugTrail(),
'executiontime' => $executiontime
),
$func,
is_object($GLOBALS['error']) && @is_callable(array($GLOBALS['error'], 'debug')) ? '' : 'DB Error'
);
}
}