From db062e373b5ca19bcbabe01d5626d638cf3e78e0 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Thu, 2 Jul 2015 23:14:25 +0200 Subject: [PATCH] Some things should not be run when Flarum is not installed yet --- framework/core/src/Core.php | 2 +- framework/core/src/Core/CoreServiceProvider.php | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/framework/core/src/Core.php b/framework/core/src/Core.php index 1c6aaa266..8772d1f27 100644 --- a/framework/core/src/Core.php +++ b/framework/core/src/Core.php @@ -9,7 +9,7 @@ class Core public static function inDebugMode() { - return app('flarum.config')['debug']; + return static::isInstalled() && app('flarum.config')['debug']; } public static function config($key, $default = null) diff --git a/framework/core/src/Core/CoreServiceProvider.php b/framework/core/src/Core/CoreServiceProvider.php index 97b44b589..28cf8f619 100644 --- a/framework/core/src/Core/CoreServiceProvider.php +++ b/framework/core/src/Core/CoreServiceProvider.php @@ -1,5 +1,6 @@ loadViewsFrom(__DIR__.'/../../views', 'flarum'); - $this->addEventHandlers(); - $this->bootModels(); - $this->addPostTypes(); - $this->grantPermissions(); - $this->mapCommandHandlers(); + if (Core::isInstalled()) { + $this->addEventHandlers(); + $this->bootModels(); + $this->addPostTypes(); + $this->grantPermissions(); + $this->mapCommandHandlers(); + } } public function mapCommandHandlers()