diff options
author | Andreas Fischer <bantu@owncloud.com> | 2014-07-29 11:14:36 +0200 |
---|---|---|
committer | Andreas Fischer <bantu@owncloud.com> | 2014-07-29 11:14:36 +0200 |
commit | 9be8ac5867e23663467068bed9532ca84788f073 (patch) | |
tree | 115a5f513908f30df6002790af5237f83baf6eeb /lib/base.php | |
parent | da391b8932fb22eb6dab20e47a1b5f9fd4e6afe5 (diff) | |
download | nextcloud-server-9be8ac5867e23663467068bed9532ca84788f073.tar.gz nextcloud-server-9be8ac5867e23663467068bed9532ca84788f073.zip |
Memcache\Factory: Remove static, use globalPrefix.
Diffstat (limited to 'lib/base.php')
-rw-r--r-- | lib/base.php | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/base.php b/lib/base.php index be0955090e0..e8565749425 100644 --- a/lib/base.php +++ b/lib/base.php @@ -477,9 +477,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) { } } |