Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions lib/kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,6 @@ public static function init() {

self::setRequiredIniValues();
self::handleAuthHeaders();
self::registerAutoloaderCache();

OC_Util::isSetLocaleWorking();

Expand Down Expand Up @@ -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
*/
Expand Down
24 changes: 0 additions & 24 deletions lib/private/Autoloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -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;
}
Expand All @@ -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) {
Expand All @@ -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;
}
}