/* 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);
}
/**
* 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()
{
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)) {