From 97bab21c1d5691480ca2a6141fe311332ac4fd5a Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Fri, 8 May 2015 20:37:07 +0200 Subject: [PATCH] Copy the config.php file upon installation. This allows us to know whether Flarum is already installed, so that we can disable certain service providers when it isn't. This should fix #67. --- framework/core/src/Console/InstallCommand.php | 3 +++ framework/core/src/Core.php | 9 +++++++++ .../src/Support/Extensions/ExtensionsServiceProvider.php | 5 ++++- 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 framework/core/src/Core.php diff --git a/framework/core/src/Console/InstallCommand.php b/framework/core/src/Console/InstallCommand.php index 4fb4131fb..e236e0dcc 100644 --- a/framework/core/src/Console/InstallCommand.php +++ b/framework/core/src/Console/InstallCommand.php @@ -47,6 +47,9 @@ class InstallCommand extends Command { $this->call('db:seed', ['--class' => 'Flarum\Core\Seeders\ConfigTableSeeder']); $this->call('db:seed', ['--class' => 'Flarum\Core\Seeders\GroupsTableSeeder']); $this->call('db:seed', ['--class' => 'Flarum\Core\Seeders\PermissionsTableSeeder']); + + // Create config file so that we know Flarum is installed + copy(base_path('../config.example.php'), base_path('../config.php')); } /** diff --git a/framework/core/src/Core.php b/framework/core/src/Core.php new file mode 100644 index 000000000..b7d853549 --- /dev/null +++ b/framework/core/src/Core.php @@ -0,0 +1,9 @@ +app; + // Extensions will not be registered if Flarum is not installed yet + if (!Core::isInstalled()) return; + $extensions = json_decode(DB::table('config')->where('key', 'extensions_enabled')->pluck('value'), true); $providers = [];