Skip to content
Merged
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
163 changes: 0 additions & 163 deletions lib/autoloader.php

This file was deleted.

34 changes: 2 additions & 32 deletions lib/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@
* OC_autoload!
*/
class OC {
/**
* Associative array for autoloading. classname => filename
*/
public static array $CLASSPATH = [];
/**
* The installation path for Nextcloud on the server (e.g. /srv/http/nextcloud)
*/
Expand Down Expand Up @@ -73,8 +69,6 @@ class OC {
*/
public static bool $CLI = false;

public static \OC\Autoloader $loader;

public static \Composer\Autoload\ClassLoader $composerAutoloader;

public static \OC\Server $server;
Expand Down Expand Up @@ -597,12 +591,6 @@ public static function init(): void {

// register autoloader
$loaderStart = microtime(true);
require_once __DIR__ . '/autoloader.php';
self::$loader = new \OC\Autoloader([
OC::$SERVERROOT . '/lib/private/legacy',
]);
spl_autoload_register([self::$loader, 'load']);
$loaderEnd = microtime(true);

self::$CLI = (php_sapi_name() == 'cli');

Expand All @@ -628,6 +616,7 @@ public static function init(): void {
print($e->getMessage());
exit();
}
$loaderEnd = microtime(true);

// setup the basic server
self::$server = new \OC\Server(\OC::$WEBROOT, self::$config);
Expand Down Expand Up @@ -656,9 +645,6 @@ public static function init(): void {
error_reporting(E_ALL);
}

$systemConfig = Server::get(\OC\SystemConfig::class);
self::registerAutoloaderCache($systemConfig);

// initialize intl fallback if necessary
OC_Util::isSetLocaleWorking();

Expand Down Expand Up @@ -692,6 +678,7 @@ public static function init(): void {
throw new \OCP\HintException('The PHP SimpleXML/PHP-XML extension is not installed.', 'Install the extension or make sure it is enabled.');
}

$systemConfig = Server::get(\OC\SystemConfig::class);
$appManager = Server::get(\OCP\App\IAppManager::class);
if ($systemConfig->getValue('installed', false)) {
$appManager->loadApps(['session']);
Expand Down Expand Up @@ -975,23 +962,6 @@ public static function registerShareHooks(\OC\SystemConfig $systemConfig): void
}
}

protected static function registerAutoloaderCache(\OC\SystemConfig $systemConfig): void {
// 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 = $systemConfig->getValue('instanceid', null);
if ($instanceId) {
try {
$memcacheFactory = Server::get(\OCP\ICacheFactory::class);
self::$loader->setMemoryCache($memcacheFactory->createLocal('Autoloader'));
} catch (\Exception $ex) {
}
}
}

/**
* Handle the request
*/
Expand Down
51 changes: 0 additions & 51 deletions tests/lib/AutoLoaderTest.php

This file was deleted.

Loading