Only use autoloader cache when 'instanceid' is available.

This commit is contained in:
Andreas Fischer 2013-10-21 15:21:37 +02:00
parent eb6637682e
commit f5e2b92688
1 changed files with 9 additions and 5 deletions

View File

@ -371,11 +371,6 @@ class OC {
// register autoloader // register autoloader
require_once __DIR__ . '/autoloader.php'; require_once __DIR__ . '/autoloader.php';
self::$loader = new \OC\Autoloader(); self::$loader = new \OC\Autoloader();
spl_autoload_register(array(self::$loader, 'load'));
try {
self::$loader->setMemoryCache(\OC\Memcache\Factory::createLowLatency('Autoloader'));
} catch(\Exception $ex) {
}
self::$loader->registerPrefix('Doctrine\\Common', 'doctrine/common/lib'); self::$loader->registerPrefix('Doctrine\\Common', 'doctrine/common/lib');
self::$loader->registerPrefix('Doctrine\\DBAL', 'doctrine/dbal/lib'); self::$loader->registerPrefix('Doctrine\\DBAL', 'doctrine/dbal/lib');
self::$loader->registerPrefix('Symfony\\Component\\Routing', 'symfony/routing'); self::$loader->registerPrefix('Symfony\\Component\\Routing', 'symfony/routing');
@ -383,6 +378,7 @@ class OC {
self::$loader->registerPrefix('Sabre\\VObject', '3rdparty'); self::$loader->registerPrefix('Sabre\\VObject', '3rdparty');
self::$loader->registerPrefix('Sabre_', '3rdparty'); self::$loader->registerPrefix('Sabre_', '3rdparty');
self::$loader->registerPrefix('Patchwork', '3rdparty'); self::$loader->registerPrefix('Patchwork', '3rdparty');
spl_autoload_register(array(self::$loader, 'load'));
// set some stuff // set some stuff
//ob_start(); //ob_start();
@ -438,6 +434,14 @@ class OC {
} }
self::initPaths(); self::initPaths();
if (OC_Config::getValue('instanceid', false)) {
// \OC\Memcache\Cache has a hidden dependency on
// OC_Util::getInstanceId() for namespacing. See #5409.
try {
self::$loader->setMemoryCache(\OC\Memcache\Factory::createLowLatency('Autoloader'));
} catch(\Exception $ex) {
}
}
OC_Util::isSetLocaleWorking(); OC_Util::isSetLocaleWorking();
// set debug mode if an xdebug session is active // set debug mode if an xdebug session is active