Add registerAutoloaderCache().

This commit is contained in:
Andreas Fischer 2014-07-29 11:18:40 +02:00
parent 9be8ac5867
commit a8fbc709ce
1 changed files with 18 additions and 15 deletions

View File

@ -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
*/