summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-03-17 13:39:22 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2015-03-17 13:39:22 +0100
commit6d5f52484e567d1e581d4f30b83a802277d6052b (patch)
tree672b30df1c3bb91092ec147d64ce1207e48797e7 /lib/private
parentf6363e67c302a473dcb8c7e63ec7b40e8981e44a (diff)
parentc233f2c90b9a27aee715c7d3653763dd5e26d4c9 (diff)
downloadnextcloud-server-6d5f52484e567d1e581d4f30b83a802277d6052b.tar.gz
nextcloud-server-6d5f52484e567d1e581d4f30b83a802277d6052b.zip
Merge pull request #14948 from owncloud/prefix-memcache
Add version and path to cache prefix
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/memcache/cache.php3
-rw-r--r--lib/private/server.php7
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/private/memcache/cache.php b/lib/private/memcache/cache.php
index c606d94fa51..d2d0353febc 100644
--- a/lib/private/memcache/cache.php
+++ b/lib/private/memcache/cache.php
@@ -21,6 +21,9 @@ abstract class Cache implements \ArrayAccess, \OCP\ICache {
$this->prefix = $prefix;
}
+ /**
+ * @return string Prefix used for caching purposes
+ */
public function getPrefix() {
return $this->prefix;
}
diff --git a/lib/private/server.php b/lib/private/server.php
index 2f688c47f09..6261337e0b1 100644
--- a/lib/private/server.php
+++ b/lib/private/server.php
@@ -157,8 +157,13 @@ class Server extends SimpleContainer implements IServerContainer {
});
$this->registerService('MemCacheFactory', function ($c) {
$config = $c->getConfig();
+ $v = \OC_App::getAppVersions();
+ $v['core'] = implode('.', \OC_Util::getVersion());
+ $version = implode(',', $v);
$instanceId = \OC_Util::getInstanceId();
- return new \OC\Memcache\Factory($instanceId,
+ $path = \OC::$SERVERROOT;
+ $prefix = md5($instanceId.'-'.$version.'-'.$path);
+ return new \OC\Memcache\Factory($prefix,
$config->getSystemValue('memcache.local', null),
$config->getSystemValue('memcache.distributed', null)
);