Dark autoloader magic for ThemingDefaults
This commit is contained in:
parent
2f1b17d44a
commit
4e1d501696
|
@ -643,10 +643,16 @@ class Server extends ServerContainer implements IServerContainer {
|
||||||
return $factory->getManager();
|
return $factory->getManager();
|
||||||
});
|
});
|
||||||
$this->registerService('ThemingDefaults', function(Server $c) {
|
$this->registerService('ThemingDefaults', function(Server $c) {
|
||||||
try {
|
/*
|
||||||
$classExists = class_exists('OCA\Theming\ThemingDefaults');
|
* Dark magic for autoloader.
|
||||||
} catch (\OCP\AutoloadNotAllowedException $e) {
|
* If we do a class_exists it will try to load the class which will
|
||||||
// App disabled or in maintenance mode
|
* 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;
|
$classExists = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue