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()