From 15c0fb7abd2a364886729d416231cac8ae0ef004 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 26 Sep 2008 15:55:01 -0400 Subject: [PATCH] handle multiple memcached servers darcs-hash:20080926195501-5ed1f-b811fac3320a0b6d8002771caa9463ba9a0889a1.gz --- classes/Memcached_DataObject.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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; } } -- 2.39.5