Skip to content

Commit 4e1d501

Browse files
committed
Dark autoloader magic for ThemingDefaults
1 parent 2f1b17d commit 4e1d501

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

lib/private/Server.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -643,10 +643,16 @@ public function __construct($webRoot, \OC\Config $config) {
643643
return $factory->getManager();
644644
});
645645
$this->registerService('ThemingDefaults', function(Server $c) {
646-
try {
647-
$classExists = class_exists('OCA\Theming\ThemingDefaults');
648-
} catch (\OCP\AutoloadNotAllowedException $e) {
649-
// App disabled or in maintenance mode
646+
/*
647+
* Dark magic for autoloader.
648+
* If we do a class_exists it will try to load the class which will
649+
* make composer cache the result. Resulting in errors when enabling
650+
* the theming app.
651+
*/
652+
$prefixes = \OC::$composerAutoloader->getPrefixesPsr4();
653+
if (isset($prefixes['OCA\\Theming\\'])) {
654+
$classExists = true;
655+
} else {
650656
$classExists = false;
651657
}
652658

0 commit comments

Comments
 (0)