handle multiple memcached servers
darcs-hash:20080926195501-5ed1f-b811fac3320a0b6d8002771caa9463ba9a0889a1.gz
This commit is contained in:
parent
4af31ca98a
commit
15c0fb7abd
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user