Add support for multiple memcached servers.

This commit is contained in:
Andreas Fischer 2013-12-09 01:34:31 +01:00
parent b6474506eb
commit 320353c237
2 changed files with 10 additions and 4 deletions

View File

@ -114,8 +114,14 @@ $CONFIG = array(
/* Password to use for sendmail mail, depends on mail_smtpauth if this is used */
"mail_smtppassword" => "",
/* memcached hostname and port (Only used when xCache, APC and APCu are absent.) */
"memcached_server" => array('localhost', 11211),
/* memcached servers (Only used when xCache, APC and APCu are absent.) */
"memcached_servers" => array(
// hostname, port and optional weight. Also see:
// http://www.php.net/manual/en/memcached.addservers.php
// http://www.php.net/manual/en/memcached.addserver.php
array('localhost', 11211),
//array('other.host.local', 11211),
),
/* How long should ownCloud keep deleted files in the trash bin, default value: 30 days */
'trashbin_retention_obligation' => 30,

View File

@ -18,8 +18,8 @@ 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', array(array('localhost', 11211)));
self::$cache->addServers($servers);
}
}