From 340a3e714b86c6bc9f2bafc2a6b64c3f41aaff8d Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Thu, 23 Jul 2009 14:21:40 -0600 Subject: [PATCH] Fix dependencies; throw Exception on error. --- framework/Memcache/lib/Horde/Memcache.php | 20 ++++++++++---------- framework/Memcache/package.xml | 6 +++++- .../lib/Horde/SessionHandler/Memcache.php | 3 --- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/framework/Memcache/lib/Horde/Memcache.php b/framework/Memcache/lib/Horde/Memcache.php index f8e048592..e900b4174 100644 --- a/framework/Memcache/lib/Horde/Memcache.php +++ b/framework/Memcache/lib/Horde/Memcache.php @@ -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() { diff --git a/framework/Memcache/package.xml b/framework/Memcache/package.xml index aff3ce5b8..87433be1d 100644 --- a/framework/Memcache/package.xml +++ b/framework/Memcache/package.xml @@ -53,7 +53,11 @@ http://pear.php.net/dtd/package-2.0.xsd"> 1.5.0 - Horde_Framework + Core + pear.horde.org + + + Exception pear.horde.org diff --git a/framework/SessionHandler/lib/Horde/SessionHandler/Memcache.php b/framework/SessionHandler/lib/Horde/SessionHandler/Memcache.php index 95450e7f6..f7209ff58 100644 --- a/framework/SessionHandler/lib/Horde/SessionHandler/Memcache.php +++ b/framework/SessionHandler/lib/Horde/SessionHandler/Memcache.php @@ -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)) { -- 2.11.0