diff options
author | Robin Appelman <icewind@owncloud.com> | 2014-01-06 13:11:38 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2014-01-06 13:11:38 +0100 |
commit | 4d65a8089284e4dde09181b56fb45b86c50d6fb5 (patch) | |
tree | ba9197301a324a7402abf218f172c52936361e21 /lib/private/memcache | |
parent | cd147bb37ae247082442f87b3cdd7d3d752e2d37 (diff) | |
download | nextcloud-server-4d65a8089284e4dde09181b56fb45b86c50d6fb5.tar.gz nextcloud-server-4d65a8089284e4dde09181b56fb45b86c50d6fb5.zip |
Remove the static dependency on OC_Util from Memcache
Diffstat (limited to 'lib/private/memcache')
-rw-r--r-- | lib/private/memcache/cache.php | 2 | ||||
-rw-r--r-- | lib/private/memcache/factory.php | 13 |
2 files changed, 14 insertions, 1 deletions
diff --git a/lib/private/memcache/cache.php b/lib/private/memcache/cache.php index 0ad1cc7ec03..03671b3f240 100644 --- a/lib/private/memcache/cache.php +++ b/lib/private/memcache/cache.php @@ -18,7 +18,7 @@ abstract class Cache implements \ArrayAccess { * @param string $prefix */ public function __construct($prefix = '') { - $this->prefix = \OC_Util::getInstanceId() . '/' . $prefix; + $this->prefix = $prefix; } public function getPrefix() { diff --git a/lib/private/memcache/factory.php b/lib/private/memcache/factory.php index fde7d947567..48c97b59551 100644 --- a/lib/private/memcache/factory.php +++ b/lib/private/memcache/factory.php @@ -10,12 +10,25 @@ namespace OC\Memcache; class Factory { /** + * @var string $globalPrefix + */ + private $globalPrefix; + + /** + * @param string $globalPrefix + */ + public function __construct($globalPrefix) { + $this->globalPrefix = $globalPrefix; + } + + /** * get a cache instance, will return null if no backend is available * * @param string $prefix * @return \OC\Memcache\Cache */ function create($prefix = '') { + $prefix = $this->globalPrefix . '/' . $prefix; if (XCache::isAvailable()) { return new XCache($prefix); } elseif (APCu::isAvailable()) { |