summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--it_dbi.class5
1 files changed, 3 insertions, 2 deletions
diff --git a/it_dbi.class b/it_dbi.class
index 6104d93..a18b9ed 100644
--- a/it_dbi.class
+++ b/it_dbi.class
@@ -36,6 +36,7 @@ class it_dbi
'classprefix' => "",
'persistent' => false,
'sqllog' => false,
+ 'sqltrace' => false,
);
var $_key; # Key of currently loaded record or null (public readonly)
@@ -63,7 +64,7 @@ function it_dbi($p = array(), $query = null)
$p += $dp;
# Combine our settings with user's defaults and class defaults
- $p += (array)$GLOBALS['it_dbi_defaultconfig'] + array('sqllog' => EDC('sqllog'), 'db' => $GLOBALS['ULTRADB']) + $this->_defaultconfig;
+ $p += (array)$GLOBALS['it_dbi_defaultconfig'] + array('sqllog' => EDC('sqllog') || EDC('sqltrace'), 'sqltrace' => EDC('sqltrace'), 'db' => $GLOBALS['ULTRADB']) + $this->_defaultconfig;
unset($this->_defaultconfig); # to shorten ED() output
$p['dbid'] = "{$p['user']}@{$p['server']}:{$p['db']}";
@@ -404,7 +405,7 @@ function query($query)
{
$end = gettimeofday();
$msec = round(($end['sec'] - $start['sec']) * 1000 + ($end['usec'] - $start['usec']) / 1000);
- it::log('sqllog', "$msec\t$query");
+ it::log('sqllog', "$msec\t$query" . ($this->_p['sqltrace'] ? "\t" . it_debug::backtrace(1) : ""));
}
return $result;