summaryrefslogtreecommitdiff
path: root/it_dbi.class
diff options
context:
space:
mode:
authorChristian Schneider2007-10-08 11:48:23 +0000
committerChristian Schneider2007-10-08 11:48:23 +0000
commite4404f222d1698b582d5966b12d1c432fb7fe147 (patch)
treebf3dff26d74775dad4466af42592efc07e5ccc22 /it_dbi.class
parentad15ebbd1f0c474d6391b70feea52a4c492bc824 (diff)
downloaditools-e4404f222d1698b582d5966b12d1c432fb7fe147.tar.gz
itools-e4404f222d1698b582d5966b12d1c432fb7fe147.tar.bz2
itools-e4404f222d1698b582d5966b12d1c432fb7fe147.zip
Added debug parameter sqltrace (sqllog with backtrace included)
Diffstat (limited to 'it_dbi.class')
-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;