From: Evan Prodromou Date: Fri, 26 Sep 2008 19:55:01 +0000 (-0400) Subject: handle multiple memcached servers X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=15c0fb7abd2a364886729d416231cac8ae0ef004;p=quix0rs-gnu-social.git handle multiple memcached servers darcs-hash:20080926195501-5ed1f-b811fac3320a0b6d8002771caa9463ba9a0889a1.gz --- diff --git a/classes/Memcached_DataObject.php b/classes/Memcached_DataObject.php index e3e7d0440f..7ca2c7db21 100644 --- a/classes/Memcached_DataObject.php +++ b/classes/Memcached_DataObject.php @@ -73,9 +73,15 @@ class Memcached_DataObject extends DB_DataObject return NULL; } else { $cache = new Memcache(); - $res = $cache->connect(common_config('memcached', 'server'), - common_config('memcached', 'port')); - return ($res) ? $cache : NULL; + $servers = common_config('memcached', 'server'); + if (is_array($servers)) { + foreach($servers as $server) { + $cache->addServer($server); + } + } else { + $cache->addServer($servers); + } + return $cache; } }