From 46e72cb2f9b755139e3c0bb4cc34897ef1e754a3 Mon Sep 17 00:00:00 2001 From: alec Date: Fri, 27 May 2011 11:02:51 +0000 Subject: - Make debug handler to be a method of rcube_mdb2 git-svn-id: https://svn.roundcube.net/trunk@4810 208e9e7b-5314-0410-a742-e7e81cd9613c --- roundcubemail/program/include/rcube_mdb2.php | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'roundcubemail/program/include') diff --git a/roundcubemail/program/include/rcube_mdb2.php b/roundcubemail/program/include/rcube_mdb2.php index 75764c497..b3976c37d 100644 --- a/roundcubemail/program/include/rcube_mdb2.php +++ b/roundcubemail/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 -- cgit v1.2.3