From fde00934f8d04914be40ccf5e48a3890a6a3485d Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Mon, 20 Jul 2015 18:02:43 +0930 Subject: [PATCH 1/2] Change order of bootstrapping 1. Enable database access 2. Load settings 3. Load extensions 4. Load Flarum core/etc This way, when the app boots, extensions get to register event listeners for events that may be fired during core/etc's boot process. --- api.php | 2 -- index.php | 2 -- system/bootstrap.php | 9 ++++++--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/api.php b/api.php index 979d8cd..e671c10 100644 --- a/api.php +++ b/api.php @@ -10,9 +10,7 @@ use Zend\Stratigility\MiddlewarePipe; $app = require __DIR__.'/system/bootstrap.php'; // Set up everything we need for the API -$app->instance('type', 'api'); $app->register('Flarum\Api\ApiServiceProvider'); -$app->register('Flarum\Support\Extensions\ExtensionsServiceProvider'); // Build a middleware pipeline for the API $api = new MiddlewarePipe(); diff --git a/index.php b/index.php index f5b0072..0bce1ce 100644 --- a/index.php +++ b/index.php @@ -10,9 +10,7 @@ use Zend\Stratigility\MiddlewarePipe; $app = require __DIR__.'/system/bootstrap.php'; // Set up everything we need for the frontend -$app->instance('type', 'forum'); $app->register('Flarum\Forum\ForumServiceProvider'); -$app->register('Flarum\Support\Extensions\ExtensionsServiceProvider'); // Build a middleware pipeline for Flarum $flarum = new MiddlewarePipe(); diff --git a/system/bootstrap.php b/system/bootstrap.php index d73624d..9745876 100644 --- a/system/bootstrap.php +++ b/system/bootstrap.php @@ -138,9 +138,12 @@ $serviceProviders = [ ]; if (Core::isInstalled()) { - $serviceProviders[] = 'Flarum\Core\CoreServiceProvider'; - $serviceProviders[] = 'Flarum\Core\DatabaseServiceProvider'; - $serviceProviders[] = 'Flarum\Console\ConsoleServiceProvider'; + $serviceProviders[] = 'Flarum\Core\DatabaseServiceProvider'; + $serviceProviders[] = 'Flarum\Core\Settings\SettingsServiceProvider'; + $serviceProviders[] = 'Flarum\Support\ExtensionsServiceProvider'; + $serviceProviders[] = 'Flarum\Core\CoreServiceProvider'; + $serviceProviders[] = 'Flarum\Locale\LocaleServiceProvider'; + $serviceProviders[] = 'Flarum\Console\ConsoleServiceProvider'; } foreach ($serviceProviders as $provider) { From 1312c816b1fc4200eb40aec0005dc5ec1253ecd0 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Tue, 21 Jul 2015 10:41:13 +0930 Subject: [PATCH 2/2] Update core --- system/core | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/core b/system/core index 22f91bb..0cb3378 160000 --- a/system/core +++ b/system/core @@ -1 +1 @@ -Subproject commit 22f91bb7e43ded9876a3749c56f23da0035711b9 +Subproject commit 0cb3378658b4a6ff3b4a8d5a06378ae8b6c5b87a