Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Server.php')
-rw-r--r--lib/private/Server.php14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/private/Server.php b/lib/private/Server.php
index d3da028a27c..55fe71d50a2 100644
--- a/lib/private/Server.php
+++ b/lib/private/Server.php
@@ -642,10 +642,16 @@ class Server extends ServerContainer implements IServerContainer {
return $factory->getManager();
});
$this->registerService('ThemingDefaults', function(Server $c) {
- try {
- $classExists = class_exists('OCA\Theming\ThemingDefaults');
- } catch (\OCP\AutoloadNotAllowedException $e) {
- // App disabled or in maintenance mode
+ /*
+ * 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 {
$classExists = false;
}