Skip to content

Commit

Permalink
Revert "Dark autoloader magic for ThemingDefaults"
Browse files Browse the repository at this point in the history
This reverts commit 4e1d501.
  • Loading branch information
ChristophWurst committed Mar 24, 2023
1 parent c11bf70 commit 8ab04ae
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions lib/private/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -1199,16 +1199,10 @@ public function __construct($webRoot, \OC\Config $config) {

$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;
}

Expand Down

0 comments on commit 8ab04ae

Please sign in to comment.