summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2023-04-03 10:38:00 +0200
committerGitHub <noreply@github.com>2023-04-03 10:38:00 +0200
commit671d2726fa43ead10a31ecab7ad244b04bcc5cb1 (patch)
tree094313c5ad5eca17b8c217c96412102233083aa9 /lib
parent8e529df6ae5dfb5df987919d11a49828e19f6dbc (diff)
parent44dc839f7b4c6196204deec58fb3e069c9f7b311 (diff)
downloadnextcloud-server-671d2726fa43ead10a31ecab7ad244b04bcc5cb1.tar.gz
nextcloud-server-671d2726fa43ead10a31ecab7ad244b04bcc5cb1.zip
Merge pull request #36652 from nextcloud/perf/autoloading/theming-authoritative-autoloader
perf(autoloading): Add authoritative autoloader for theming
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Server.php14
1 files changed, 4 insertions, 10 deletions
diff --git a/lib/private/Server.php b/lib/private/Server.php
index f1e96170886..92ef5d50513 100644
--- a/lib/private/Server.php
+++ b/lib/private/Server.php
@@ -1199,16 +1199,10 @@ class Server extends ServerContainer implements IServerContainer {
$this->registerAlias(\OC_Defaults::class, 'ThemingDefaults');
$this->registerService('ThemingDefaults', function (Server $c) {
- /*
- * Dark magic for autoloader.
- * If we do a class_exists it will try to load the class which will
- * make composer cache the result. Resulting in errors when enabling
- * the theming app.
- */
- $prefixes = \OC::$composerAutoloader->getPrefixesPsr4();
- if (isset($prefixes['OCA\\Theming\\'])) {
- $classExists = true;
- } else {
+ try {
+ $classExists = class_exists('OCA\Theming\ThemingDefaults');
+ } catch (\OCP\AutoloadNotAllowedException $e) {
+ // App disabled or in maintenance mode
$classExists = false;
}