From 593608f25ce34eb3e71334c1c569894b94469062 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 25 Jul 2016 09:46:07 +0200 Subject: [PATCH] Make sure we try to autoload the class --- lib/private/server.php | 8 +++++++- lib/private/urlgenerator.php | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) 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;