diff options
author | alecpl <alec@alec.pl> | 2011-05-27 11:02:51 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2011-05-27 11:02:51 +0000 |
commit | f5a55bf173be2378db79860ced8486374971e72f (patch) | |
tree | a94974e1039914e6e17366027bcee1a54ae6f50c /program/include/rcube_mdb2.php | |
parent | 8254d9c7cb5807d8c0b5112b318cef8a38634c55 (diff) |
- Make debug handler to be a method of rcube_mdb2
Diffstat (limited to 'program/include/rcube_mdb2.php')
-rw-r--r-- | program/include/rcube_mdb2.php | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/program/include/rcube_mdb2.php b/program/include/rcube_mdb2.php index 75764c497..b3976c37d 100644 --- a/program/include/rcube_mdb2.php +++ b/program/include/rcube_mdb2.php @@ -84,7 +84,7 @@ class rcube_mdb2 'persistent' => $this->db_pconn, 'emulate_prepared' => $this->debug_mode, 'debug' => $this->debug_mode, - 'debug_handler' => 'mdb2_debug_handler', + 'debug_handler' => array($this, 'debug_handler'), 'portability' => MDB2_PORTABILITY_ALL ^ MDB2_PORTABILITY_EMPTY_TO_NULL); if ($this->db_provider == 'pgsql') { @@ -787,16 +787,17 @@ class rcube_mdb2 'md5', 'rcube_sqlite_md5'); } -} // end class rcube_db - -/* this is our own debug handler for the MDB2 connection */ -function mdb2_debug_handler(&$db, $scope, $message, $context = array()) -{ - if ($scope != 'prepare') { - $debug_output = sprintf('%s(%d): %s;', - $scope, $db->db_index, rtrim($message, ';')); - write_log('sql', $debug_output); + /** + * Debug handler for the MDB2 + */ + function debug_handler(&$db, $scope, $message, $context = array()) + { + if ($scope != 'prepare') { + $debug_output = sprintf('%s(%d): %s;', + $scope, $db->db_index, rtrim($message, ';')); + write_log('sql', $debug_output); + } } -} +} // end class rcube_db |