Permalink
Browse files

- fixed bug in defining custom debug handler (bug #3113)

git-svn-id: http://svn.php.net/repository/pear/packages/MDB/trunk@176723 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
1 parent 417e324 commit 4760a297514e31b9365e398161a0d12bb1f04013 Lukas Smith committed Jan 9, 2005
Showing with 4 additions and 16 deletions.
  1. +4 −16 MDB/Common.php
View
@@ -202,12 +202,6 @@ class MDB_Common extends PEAR
*/
var $debug_output = '';
- /**
- * @var boolean
- * @access private
- */
- var $pass_debug_handle = FALSE;
-
/**
* @var boolean
* @access private
@@ -502,15 +496,13 @@ function getOption($option)
/**
* set a debug handler
*
- * @param string $capture name of the function that should be used in
- * debug()
+ * @param string $capture name of the function that should be used in debug()
* @access public
* @see debug()
*/
- function captureDebugOutput($capture)
+ function captureDebugOutput($capture = 'MDB_defaultDebugOutput')
{
- $this->pass_debug_handle = $capture;
- $this->debug = ($capture ? 'MDB_defaultDebugOutput' : '');
+ $this->debug = ($capture ? $capture : false);
}
// }}}
@@ -525,11 +517,7 @@ function captureDebugOutput($capture)
function debug($message)
{
if (strcmp($function = $this->debug, '')) {
- if ($this->pass_debug_handle) {
- $function($this, $message);
- } else {
- $function($message);
- }
+ $function($this, $message);
}
}

0 comments on commit 4760a29

Please sign in to comment.