aboutsummaryrefslogtreecommitdiffstats
path: root/lib/base.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/base.php')
-rw-r--r--lib/base.php44
1 files changed, 7 insertions, 37 deletions
diff --git a/lib/base.php b/lib/base.php
index 639568cf640..55856889489 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -40,10 +40,6 @@ require_once 'public/Constants.php';
*/
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)
*/
public static string $SERVERROOT = '';
@@ -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;
@@ -597,15 +591,6 @@ class OC {
// register autoloader
$loaderStart = microtime(true);
- require_once __DIR__ . '/autoloader.php';
- self::$loader = new \OC\Autoloader([
- OC::$SERVERROOT . '/lib/private/legacy',
- ]);
- if (defined('PHPUNIT_RUN')) {
- self::$loader->addValidRoot(OC::$SERVERROOT . '/tests');
- }
- spl_autoload_register([self::$loader, 'load']);
- $loaderEnd = microtime(true);
self::$CLI = (php_sapi_name() == 'cli');
@@ -631,6 +616,10 @@ class OC {
print($e->getMessage());
exit();
}
+ $loaderEnd = microtime(true);
+
+ // Enable lazy loading if activated
+ \OC\AppFramework\Utility\SimpleContainer::$useLazyObjects = (bool)self::$config->getValue('enable_lazy_objects', true);
// setup the basic server
self::$server = new \OC\Server(\OC::$WEBROOT, self::$config);
@@ -659,9 +648,6 @@ class OC {
error_reporting(E_ALL);
}
- $systemConfig = Server::get(\OC\SystemConfig::class);
- self::registerAutoloaderCache($systemConfig);
-
// initialize intl fallback if necessary
OC_Util::isSetLocaleWorking();
@@ -695,6 +681,7 @@ class OC {
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']);
@@ -787,8 +774,8 @@ class OC {
// Make sure that the application class is not loaded before the database is setup
if ($systemConfig->getValue('installed', false)) {
$appManager->loadApp('settings');
- /* Build core application to make sure that listeners are registered */
- Server::get(\OC\Core\Application::class);
+ /* Run core application registration */
+ $bootstrapCoordinator->runLazyRegistration('core');
}
//make sure temporary files are cleaned up
@@ -978,23 +965,6 @@ class OC {
}
}
- 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
*/