diff --git a/lib/private/server.php b/lib/private/server.php index 43a41cbc01c98..9a254b55f33ca 100644 --- a/lib/private/server.php +++ b/lib/private/server.php @@ -567,7 +567,13 @@ public function __construct($webRoot, \OC\Config $config) { return $factory->getManager(); }); $this->registerService('ThemingDefaults', function(Server $c) { - if(class_exists('OCA\Theming\Template', false) && $this->getConfig()->getSystemValue('installed', false) && $this->getAppManager()->isInstalled('theming')) { + try { + $classExists = class_exists('OCA\Theming\Template'); + } catch (\OCP\AutoloadNotAllowedException $e) { + // App disabled or in maintenance mode + $classExists = false; + } + if ($classExists && $this->getConfig()->getSystemValue('installed', false) && $this->getAppManager()->isInstalled('theming')) { return new Template( $this->getConfig(), $this->getL10N('theming'), diff --git a/lib/private/urlgenerator.php b/lib/private/urlgenerator.php index ee4ce349ea23a..62649781c353e 100644 --- a/lib/private/urlgenerator.php +++ b/lib/private/urlgenerator.php @@ -29,7 +29,8 @@ */ namespace OC; -use OC_Defaults; + + use OCP\ICacheFactory; use OCP\IConfig; use OCP\IURLGenerator;