From: Joas Schilling Date: Fri, 22 Jul 2016 14:49:33 +0000 (+0200) Subject: Make sure we try to autoload the class X-Git-Tag: v10.0RC1~78^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=28dffaa32f3f05c4009fb6f38a71c6658136427b;p=nextcloud-server.git Make sure we try to autoload the class --- diff --git a/lib/private/Server.php b/lib/private/Server.php index de2970d9bfa..76d6bbad1ef 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -631,7 +631,14 @@ class Server extends ServerContainer implements IServerContainer { 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 0f3c60b1323..93517dc9f7e 100644 --- a/lib/private/URLGenerator.php +++ b/lib/private/URLGenerator.php @@ -30,7 +30,8 @@ */ namespace OC; -use OCP\Defaults; + + use OCP\ICacheFactory; use OCP\IConfig; use OCP\IURLGenerator;