summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2016-08-24 13:22:21 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2016-08-24 13:22:21 +0200
commit4e1d50169651f608e4728d72c07e463c62a39b87 (patch)
tree7319f470fa844d1f9c22ac3cdebad68f3136e840 /lib
parent2f1b17d44a854221a4b3c461df80d0522ac3c8b5 (diff)
downloadnextcloud-server-4e1d50169651f608e4728d72c07e463c62a39b87.tar.gz
nextcloud-server-4e1d50169651f608e4728d72c07e463c62a39b87.zip
Dark autoloader magic for ThemingDefaults
Diffstat (limited to 'lib')
-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 86eee54be70..b651285e9a5 100644
--- a/lib/private/Server.php
+++ b/lib/private/Server.php
@@ -643,10 +643,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;
}