From bc5e3fc94d7ecdce00d5c6ca5c637cb232eb16c8 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Thu, 25 Mar 2010 01:26:51 -0600 Subject: [PATCH] Do PEAR_LOG checking without loading Log.php --- framework/Alarm/test/Horde/Alarm/setup.inc.dist | 1 - framework/Core/lib/Horde.php | 10 +++++++++- framework/Core/lib/Horde/Registry.php | 3 --- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/framework/Alarm/test/Horde/Alarm/setup.inc.dist b/framework/Alarm/test/Horde/Alarm/setup.inc.dist index 726a92b5a..0fa5e513a 100644 --- a/framework/Alarm/test/Horde/Alarm/setup.inc.dist +++ b/framework/Alarm/test/Horde/Alarm/setup.inc.dist @@ -5,7 +5,6 @@ $params = array('phptype' => 'mysql', 'password' => 'horde', 'charset' => 'iso-8859-1'); -require_once 'Log.php'; $conf['log'] = array('priority' => 'DEBUG', 'ident' => 'HORDE', 'params' => array('append' => true), diff --git a/framework/Core/lib/Horde.php b/framework/Core/lib/Horde.php index 39155c58f..169f5faea 100644 --- a/framework/Core/lib/Horde.php +++ b/framework/Core/lib/Horde.php @@ -673,7 +673,15 @@ HTML; $output = ob_get_clean(); if (!empty($output) && !$show_output) { - throw new Horde_Exception(sprintf('Failed to import configuration file "%s": ', $file) . strip_tags($output)); + /* Horde 3 -> 4 conversion checking. This is the only place + * to catch PEAR_LOG errors. */ + if (isset($conf['log']['priority']) && + (strpos($conf['log'], 'PEAR_LOG_') !== false)) { + $conf['log']['priority'] = 'INFO'; + self::logMessage('Logging priority is using the old PEAR_LOG constant', 'INFO'); + } else { + throw new Horde_Exception(sprintf('Failed to import configuration file "%s": ', $file) . strip_tags($output)); + } } if (!$success) { diff --git a/framework/Core/lib/Horde/Registry.php b/framework/Core/lib/Horde/Registry.php index 3a9cb5dbc..4a5fd8c50 100644 --- a/framework/Core/lib/Horde/Registry.php +++ b/framework/Core/lib/Horde/Registry.php @@ -292,9 +292,6 @@ class Horde_Registry * 'horde', registry is not used in the method so we are free to * call it here (prevents us from duplicating a bunch of code * here. */ - /* Load Log.php so we can update Horde 3 configurations which still - * use the PEAR_LOG_* contants. */ - @include_once 'Log.php'; $this->_cache['conf-horde'] = Horde::loadConfiguration('conf.php', 'conf', 'horde'); $conf = $GLOBALS['conf'] = &$this->_cache['conf-horde']; -- 2.11.0