mirror of
https://github.com/flarum/core.git
synced 2025-08-03 06:57:54 +02:00
Some things should not be run when Flarum is not installed yet
This commit is contained in:
@@ -9,7 +9,7 @@ class Core
|
|||||||
|
|
||||||
public static function inDebugMode()
|
public static function inDebugMode()
|
||||||
{
|
{
|
||||||
return app('flarum.config')['debug'];
|
return static::isInstalled() && app('flarum.config')['debug'];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function config($key, $default = null)
|
public static function config($key, $default = null)
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
<?php namespace Flarum\Core;
|
<?php namespace Flarum\Core;
|
||||||
|
|
||||||
|
use Flarum\Core;
|
||||||
use Illuminate\Bus\Dispatcher as Bus;
|
use Illuminate\Bus\Dispatcher as Bus;
|
||||||
use Illuminate\Contracts\Container\Container;
|
use Illuminate\Contracts\Container\Container;
|
||||||
use Flarum\Support\ServiceProvider;
|
use Flarum\Support\ServiceProvider;
|
||||||
@@ -23,12 +24,14 @@ class CoreServiceProvider extends ServiceProvider
|
|||||||
{
|
{
|
||||||
$this->loadViewsFrom(__DIR__.'/../../views', 'flarum');
|
$this->loadViewsFrom(__DIR__.'/../../views', 'flarum');
|
||||||
|
|
||||||
|
if (Core::isInstalled()) {
|
||||||
$this->addEventHandlers();
|
$this->addEventHandlers();
|
||||||
$this->bootModels();
|
$this->bootModels();
|
||||||
$this->addPostTypes();
|
$this->addPostTypes();
|
||||||
$this->grantPermissions();
|
$this->grantPermissions();
|
||||||
$this->mapCommandHandlers();
|
$this->mapCommandHandlers();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function mapCommandHandlers()
|
public function mapCommandHandlers()
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user