mirror of
https://github.com/flarum/framework.git
synced 2025-01-21 12:45:17 +08:00
Some things should not be run when Flarum is not installed yet
This commit is contained in:
parent
5b7dafa0af
commit
db062e373b
|
@ -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)
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<?php namespace Flarum\Core;
|
||||
|
||||
use Flarum\Core;
|
||||
use Illuminate\Bus\Dispatcher as Bus;
|
||||
use Illuminate\Contracts\Container\Container;
|
||||
use Flarum\Support\ServiceProvider;
|
||||
|
@ -23,11 +24,13 @@ class CoreServiceProvider extends ServiceProvider
|
|||
{
|
||||
$this->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()
|
||||
|
|
Loading…
Reference in New Issue
Block a user