Index: branches/5.3.x/core/kernel/db/db_connection.php =================================================================== diff -u -N -r15931 -r15956 --- branches/5.3.x/core/kernel/db/db_connection.php (.../db_connection.php) (revision 15931) +++ branches/5.3.x/core/kernel/db/db_connection.php (.../db_connection.php) (revision 15956) @@ -1,6 +1,6 @@ serverIndex = $server_index; + $this->setErrorHandler($error_handler ? $error_handler : array(&$this, 'handleError')); + $this->_captureStatistics = defined('DBG_CAPTURE_STATISTICS') && DBG_CAPTURE_STATISTICS && !(defined('ADMIN') && ADMIN); + } - if ( !$error_handler ) { - $this->errorHandler = Array(&$this, 'handleError'); - } - else { - $this->errorHandler = $error_handler; - } + /** + * Sets new error handler. + * + * @param mixed $error_handler Error handler. + * + * @return self + */ + public function setErrorHandler($error_handler) + { + $this->errorHandler = $error_handler; - $this->_captureStatistics = defined('DBG_CAPTURE_STATISTICS') && DBG_CAPTURE_STATISTICS && !(defined('ADMIN') && ADMIN); + return $this; } /**