From: Michael M Slusarz Date: Fri, 19 Mar 2010 20:03:50 +0000 (-0600) Subject: Revert "Need to registry the deprecated callback *after* the autoloader is initialized." X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=a68fbe3eb4e44bfff12d4c2163ae33919075e52c;p=horde.git Revert "Need to registry the deprecated callback *after* the autoloader is initialized." This reverts commit 87562acdb7337553fcbb432b9bbff4307136c8b2. Just ignore Exceptions that are thrown if the logging handler is not yet setup. And don't try to log at all if log handler is not yet available. --- diff --git a/framework/Core/lib/Horde.php b/framework/Core/lib/Horde.php index 3e7ea37fa..5ee01e541 100644 --- a/framework/Core/lib/Horde.php +++ b/framework/Core/lib/Horde.php @@ -136,7 +136,9 @@ class Horde // Log the error via logMessage() if requested. if ($log) { - self::logMessage($error, 'EMERG'); + try { + self::logMessage($error, 'EMERG'); + } catch (Exception $e) {} } if ($cli) { @@ -164,7 +166,11 @@ HTML; static public function logDeprecated($errno, $errstr, $errfile, $errline, $errcontext) { - self::logMessage(new ErrorException($errstr, 0, $errno, $errfile, $errline), 'DEBUG'); + if (class_exists('Horde_Log')) { + try { + self::logMessage(new ErrorException($errstr, 0, $errno, $errfile, $errline), 'DEBUG'); + } catch (Exception $e) {} + } } /** diff --git a/framework/Core/lib/Horde/Registry.php b/framework/Core/lib/Horde/Registry.php index e106f0f5f..481a408f3 100644 --- a/framework/Core/lib/Horde/Registry.php +++ b/framework/Core/lib/Horde/Registry.php @@ -184,10 +184,6 @@ class Horde_Registry try { $GLOBALS['registry']->pushApp($app, array('check_perms' => ($args['authentication'] != 'none'), 'logintasks' => !$args['nologintasks'])); - /* Catch and log E_DEPRECATED errors. */ - if (defined('E_DEPRECATED')) { - set_error_handler(array('Horde', 'logDeprecated'), E_DEPRECATED); - } if ($args['admin'] && !Horde_Auth::isAdmin()) { throw new Horde_Exception('Not an admin'); } diff --git a/horde/lib/core.php b/horde/lib/core.php index 17725e0bb..63490cf90 100644 --- a/horde/lib/core.php +++ b/horde/lib/core.php @@ -42,3 +42,7 @@ Horde_Autoloader::addClassPattern('/^Horde(?:$|_)/i', dirname(__FILE__)); * 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); +}