Fix dependencies; throw Exception on error.
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 23 Jul 2009 20:21:40 +0000 (14:21 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 23 Jul 2009 20:28:50 +0000 (14:28 -0600)
framework/Memcache/lib/Horde/Memcache.php
framework/Memcache/package.xml
framework/SessionHandler/lib/Horde/SessionHandler/Memcache.php

index f8e0485..e900b41 100644 (file)
@@ -124,17 +124,17 @@ class Horde_Memcache
 
         /* Check if any of the connections worked. */
         if (empty($servers)) {
-            Horde::logMessage('Could not connect to any defined memcache servers.' , __FILE__, __LINE__, PEAR_LOG_ERR);
-        } else {
-            if (!empty($this->_params['c_threshold'])) {
-                $this->_memcache->setCompressThreshold($this->_params['c_threshold']);
-            }
-
-            // Force consistent hashing
-            ini_set('memcache.hash_strategy', 'consistent');
+            throw new Horde_Exception('Could not connect to any defined memcache servers.');
+        }
 
-            Horde::logMessage('Connected to the following memcache servers:' . implode($servers, ', '), __FILE__, __LINE__, PEAR_LOG_DEBUG);
+        if (!empty($this->_params['c_threshold'])) {
+            $this->_memcache->setCompressThreshold($this->_params['c_threshold']);
         }
+
+        // Force consistent hashing
+        ini_set('memcache.hash_strategy', 'consistent');
+
+        Horde::logMessage('Connected to the following memcache servers:' . implode($servers, ', '), __FILE__, __LINE__, PEAR_LOG_DEBUG);
     }
 
     /**
@@ -398,7 +398,7 @@ class Horde_Memcache
      * Get the statistics output from the current memcache pool.
      *
      * @return array  The output from Memcache::getExtendedStats() using the
-     *                current Horde configuration values.
+     *                current configuration values.
      */
     public function stats()
     {
index aff3ce5..87433be 100644 (file)
@@ -53,7 +53,11 @@ http://pear.php.net/dtd/package-2.0.xsd">
     <min>1.5.0</min>
    </pearinstaller>
    <package>
-    <name>Horde_Framework</name>
+    <name>Core</name>
+    <channel>pear.horde.org</channel>
+   </package>
+   <package>
+    <name>Exception</name>
     <channel>pear.horde.org</channel>
    </package>
    <extension>
index 95450e7..f7209ff 100644 (file)
@@ -114,9 +114,6 @@ class Horde_SessionHandler_Memcache extends Horde_SessionHandler
     protected function _open($save_path = null, $session_name = null)
     {
         $this->_memcache = Horde_Memcache::singleton();
-        if (is_a($this->_memcache, 'PEAR_Error')) {
-            throw new Horde_Exception($this->_memcache);
-        }
 
         if (isset($this->_persistent)) {
             if (!$this->_persistent->open($save_path, $session_name)) {