summaryrefslogtreecommitdiffstats
path: root/lib/base.php
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@owncloud.com>2014-07-29 11:14:36 +0200
committerJörn Friedrich Dreyer <jfd@butonic.de>2014-08-06 21:40:38 +0200
commitcc1d95cbe5e97b8ca176646a8e74e570c6cd942a (patch)
tree3c9b2348d5d1289a6348204113eeec5bfa2f316c /lib/base.php
parentef6a0254f94b9dca34a5f0495d9cc709a5ce6381 (diff)
downloadnextcloud-server-cc1d95cbe5e97b8ca176646a8e74e570c6cd942a.tar.gz
nextcloud-server-cc1d95cbe5e97b8ca176646a8e74e570c6cd942a.zip
Memcache\Factory: Remove static, use globalPrefix.
Diffstat (limited to 'lib/base.php')
-rw-r--r--lib/base.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/base.php b/lib/base.php
index 407f1a6b13d..240ac6cb034 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -475,9 +475,18 @@ class OC {
self::handleAuthHeaders();
self::initPaths();
- if (OC_Config::getValue('instanceid', false)) {
+
+ // The class loader takes an optional low-latency cache, which MUST be
+ // namespaced. The instanceid is used for namespacing, but might be
+ // unavailable at this point. Futhermore, it might not be possible to
+ // generate an instanceid via \OC_Util::getInstanceId() because the
+ // config file may not be writable. As such, we only register a class
+ // loader cache if instanceid is available without trying to create one.
+ $instanceId = OC_Config::getValue('instanceid', null);
+ if ($instanceId) {
try {
- self::$loader->setMemoryCache(\OC\Memcache\Factory::createLowLatency('Autoloader'));
+ $memcacheFactory = new \OC\Memcache\Factory($instanceId);
+ self::$loader->setMemoryCache($memcacheFactory->createLowLatency('Autoloader'));
} catch (\Exception $ex) {
}
}