Do PEAR_LOG checking without loading Log.php
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 25 Mar 2010 07:26:51 +0000 (01:26 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 25 Mar 2010 07:26:51 +0000 (01:26 -0600)
framework/Alarm/test/Horde/Alarm/setup.inc.dist
framework/Core/lib/Horde.php
framework/Core/lib/Horde/Registry.php

index 726a92b..0fa5e51 100644 (file)
@@ -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),
index 39155c5..169f5fa 100644 (file)
@@ -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) {
index 3a9cb5d..4a5fd8c 100644 (file)
@@ -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'];