Skip to content
Snippets Groups Projects
Commit 320353c2 authored by Andreas Fischer's avatar Andreas Fischer
Browse files

Add support for multiple memcached servers.

parent b6474506
No related branches found
No related tags found
No related merge requests found
......@@ -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,
......
......@@ -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);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment