diff --git a/lib/kernel.php b/lib/kernel.php index 33ae1465496a..5dfb2c3c284e 100644 --- a/lib/kernel.php +++ b/lib/kernel.php @@ -576,7 +576,6 @@ public static function init() { self::setRequiredIniValues(); self::handleAuthHeaders(); - self::registerAutoloaderCache(); OC_Util::isSetLocaleWorking(); @@ -823,24 +822,6 @@ public static function registerShareHooks() { } } - 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. Furthermore, 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::$server->getSystemConfig()->getValue('instanceid', null); - if ($instanceId) { - try { - $memcacheFactory = \OC::$server->getMemCacheFactory(); - '@phan-var \OC\MemCache\Factory $memcacheFactory'; - self::$loader->setMemoryCache($memcacheFactory->createLocal('Autoloader')); - } catch (\Exception $ex) { - } - } - } - /** * Handle the request */ diff --git a/lib/private/Autoloader.php b/lib/private/Autoloader.php index 33bd5cfc561a..3d9680e2daa7 100644 --- a/lib/private/Autoloader.php +++ b/lib/private/Autoloader.php @@ -37,13 +37,6 @@ class Autoloader { /** @var array */ private $validRoots = []; - /** - * Optional low-latency memory cache for class to path mapping. - * - * @var \OC\Memcache\Cache - */ - protected $memoryCache; - /** * Autoloader constructor. * @@ -120,10 +113,6 @@ protected function isValidPath($fullPath) { */ public function load($class) { $pathsToRequire = null; - if ($this->memoryCache) { - $pathsToRequire = $this->memoryCache->get($class); - } - if (\class_exists($class, false)) { return false; } @@ -137,10 +126,6 @@ public function load($class) { $pathsToRequire[] = $fullPath; } } - - if ($this->memoryCache) { - $this->memoryCache->set($class, $pathsToRequire, 60); // cache 60 sec - } } foreach ($pathsToRequire as $fullPath) { @@ -149,13 +134,4 @@ public function load($class) { return false; } - - /** - * Sets the optional low-latency cache for class to path mapping. - * - * @param \OC\Memcache\Cache $memoryCache Instance of memory cache. - */ - public function setMemoryCache(\OC\Memcache\Cache $memoryCache = null) { - $this->memoryCache = $memoryCache; - } }