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.
pull/9/head
Toby Zerner 9 years ago
parent 39ec918232
commit fde00934f8

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

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

@ -138,8 +138,11 @@ $serviceProviders = [
];
if (Core::isInstalled()) {
$serviceProviders[] = 'Flarum\Core\CoreServiceProvider';
$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';
}

Loading…
Cancel
Save