From: Michael M Slusarz Date: Wed, 20 Jan 2010 17:29:29 +0000 (-0700) Subject: Catch/log E_DEPRECATED errors X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=37fcbf357e8ca4be29e47c83c6897665b992d2e2;p=horde.git Catch/log E_DEPRECATED errors --- diff --git a/framework/Core/lib/Horde.php b/framework/Core/lib/Horde.php index ef3f8bb2c..f764f8b25 100644 --- a/framework/Core/lib/Horde.php +++ b/framework/Core/lib/Horde.php @@ -264,6 +264,21 @@ HTML; } /** + * Log deprecated errors. + * + * @param integer $errno See set_error_handler(). + * @param string $errstr See set_error_handler(). + * @param string $errfile See set_error_handler(). + * @param integer $errline See set_error_handler(). + * @param array $errcontext See set_error_handler(). + */ + static public function logDeprecated($errno, $errstr, $errfile, $errline, + $errcontext) + { + self::logMessage($errstr, $errfile, $errline, PEAR_LOG_DEBUG); + } + + /** * Adds the javascript code to the output (if output has already started) * or to the list of script files to include via includeScriptFiles(). * diff --git a/horde/lib/core.php b/horde/lib/core.php index e92c512dd..c6baf3bc8 100644 --- a/horde/lib/core.php +++ b/horde/lib/core.php @@ -48,5 +48,10 @@ include_once 'Log.php'; * output this unless an admin. */ set_exception_handler(array('Horde', 'fatal')); +/* Catch and log E_DEPRECATED errors. */ +if (defined('E_DEPRECATED')) { + set_error_handler(array('Horde', 'logDeprecated'), E_DEPRECATED); +} + /* Browser detection object. */ $browser = Horde_Browser::singleton();