diff options
author | Urban Müller | 2008-01-25 14:51:05 +0000 |
---|---|---|
committer | Urban Müller | 2008-01-25 14:51:05 +0000 |
commit | 94dcecb4beb7db6ac54a3eabcb635998db616cce (patch) | |
tree | 35d09df5ba5ac666616652bae5b87d98e202086c /it_dbi.class | |
parent | f901cf85abe0d2b534e7bdd51812efbc2d6baf80 (diff) | |
download | itools-94dcecb4beb7db6ac54a3eabcb635998db616cce.tar.gz itools-94dcecb4beb7db6ac54a3eabcb635998db616cce.tar.bz2 itools-94dcecb4beb7db6ac54a3eabcb635998db616cce.zip |
allow enabling sqllog after constructor
Diffstat (limited to 'it_dbi.class')
-rw-r--r-- | it_dbi.class | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/it_dbi.class b/it_dbi.class index 5552c6d..18b5052 100644 --- a/it_dbi.class +++ b/it_dbi.class @@ -35,8 +35,6 @@ class it_dbi #'keyfield' => 'ID', # Don't set to null here, filled later by _get_field_info() 'classprefix' => "", 'persistent' => false, - 'sqllog' => false, - 'sqltrace' => false, ); var $_key; # Key of currently loaded record or null (public readonly) @@ -65,7 +63,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') || EDC('sqltrace'), 'sqltrace' => EDC('sqltrace'), 'db' => $GLOBALS['ULTRADB']) + $this->_defaultconfig; + $p += (array)$GLOBALS['it_dbi_defaultconfig'] + array('db' => $GLOBALS['ULTRADB']) + $this->_defaultconfig; unset($this->_defaultconfig); # to shorten ED() output $p['dbid'] = "{$p['user']}@{$p['server']}:{$p['db']}"; @@ -391,11 +389,11 @@ function query($query) } - if ($this->_p['sqllog']) + if ($GLOBALS['debug_sqllog']) { $end = gettimeofday(); $msec = round(($end['sec'] - $start['sec']) * 1000 + ($end['usec'] - $start['usec']) / 1000); - it::log('sqllog', "$msec\t$query" . ($this->_p['sqltrace'] ? "\t" . it_debug::backtrace(1) : "")); + it::log('sqllog', "$msec\t$query" . (EDC('sqltrace') ? "\t" . it_debug::backtrace(1) : "")); } return $result; |