summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2016-07-25 08:37:13 +0200
committerGitHub <noreply@github.com>2016-07-25 08:37:13 +0200
commitde4236bc4ae1a02141e1bf6d9ab60a9836cd965a (patch)
tree7961399533896795087983ce6b1dd33db9f4c074 /lib
parent7d969962db9d1c59ae60c44ac3770a20721c17a8 (diff)
parent8cea95390dc2af3b50bb032571e29e29167dcfa5 (diff)
downloadnextcloud-server-de4236bc4ae1a02141e1bf6d9ab60a9836cd965a.tar.gz
nextcloud-server-de4236bc4ae1a02141e1bf6d9ab60a9836cd965a.zip
Merge pull request #530 from nextcloud/fix-theme-loading
Make sure we try to autoload the class
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Server.php9
-rw-r--r--lib/private/URLGenerator.php3
2 files changed, 10 insertions, 2 deletions
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;