aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@owncloud.com>2014-07-29 11:18:40 +0200
committerAndreas Fischer <bantu@owncloud.com>2014-07-29 11:18:40 +0200
commita8fbc709ce141257df1c1edf3eac3bb154db29a5 (patch)
treecde9160e0a3387a9112dd49d66751281574e0c59
parent9be8ac5867e23663467068bed9532ca84788f073 (diff)
downloadnextcloud-server-a8fbc709ce141257df1c1edf3eac3bb154db29a5.tar.gz
nextcloud-server-a8fbc709ce141257df1c1edf3eac3bb154db29a5.zip
Add registerAutoloaderCache().
-rw-r--r--lib/base.php33
1 files changed, 18 insertions, 15 deletions
diff --git a/lib/base.php b/lib/base.php
index e8565749425..6751f897dfc 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -475,23 +475,9 @@ class OC {
@ini_set('file_uploads', '50');
self::handleAuthHeaders();
-
self::initPaths();
+ self::registerAutoloaderCache();
- // 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 {
- $memcacheFactory = new \OC\Memcache\Factory($instanceId);
- self::$loader->setMemoryCache($memcacheFactory->createLowLatency('Autoloader'));
- } catch (\Exception $ex) {
- }
- }
OC_Util::isSetLocaleWorking();
// setup 3rdparty autoloader
@@ -651,6 +637,23 @@ class OC {
}
}
+ protected static function registerAutoloaderCache() {
+ // 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 {
+ $memcacheFactory = new \OC\Memcache\Factory($instanceId);
+ self::$loader->setMemoryCache($memcacheFactory->createLowLatency('Autoloader'));
+ } catch (\Exception $ex) {
+ }
+ }
+ }
+
/**
* Handle the request
*/