diff options
author | Andreas Fischer <bantu@owncloud.com> | 2014-02-08 14:21:19 +0100 |
---|---|---|
committer | Andreas Fischer <bantu@owncloud.com> | 2014-02-08 14:21:19 +0100 |
commit | bbfd97ce0335f1664d14a696796f9f2c10f2a3bb (patch) | |
tree | e2bb8a1e097a4f88b4dea5aa4fc5b3b60432d6b7 /lib/private/memcache | |
parent | 91254c304d454b6f7977037dbd5dd2db5e00ff9f (diff) | |
parent | acd81f6c694373a18a0ee9ba29075b9924603c25 (diff) | |
download | nextcloud-server-bbfd97ce0335f1664d14a696796f9f2c10f2a3bb.tar.gz nextcloud-server-bbfd97ce0335f1664d14a696796f9f2c10f2a3bb.zip |
Merge pull request #6247 from owncloud/memcached-multiple-servers
Add support for multiple memcached servers.
* owncloud/memcached-multiple-servers:
Readd support for memcached_server config variable.
Add support for multiple memcached servers.
Diffstat (limited to 'lib/private/memcache')
-rw-r--r-- | lib/private/memcache/memcached.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/private/memcache/memcached.php b/lib/private/memcache/memcached.php index 978e6c2eff1..075828eebad 100644 --- a/lib/private/memcache/memcached.php +++ b/lib/private/memcache/memcached.php @@ -18,8 +18,16 @@ class Memcached extends Cache { parent::__construct($prefix); if (is_null(self::$cache)) { self::$cache = new \Memcached(); - list($host, $port) = \OC_Config::getValue('memcached_server', array('localhost', 11211)); - self::$cache->addServer($host, $port); + $servers = \OC_Config::getValue('memcached_servers'); + if (!$servers) { + $server = \OC_Config::getValue('memcached_server'); + if ($server) { + $servers = array($server); + } else { + $servers = array(array('localhost', 11211)); + } + } + self::$cache->addServers($servers); } } |