Skip to content

Commit

Permalink
Dark autoloader magic for ThemingDefaults
Browse files Browse the repository at this point in the history
  • Loading branch information
rullzer committed Aug 24, 2016
1 parent 2f1b17d commit 4e1d501
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions lib/private/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -643,10 +643,16 @@ public function __construct($webRoot, \OC\Config $config) {
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;
}

Expand Down

0 comments on commit 4e1d501

Please sign in to comment.