Load installer if not installed

pull/9/head
Toby Zerner 2015-08-17 14:12:52 +09:30
parent 5a7d97baf8
commit 718c2e053d
1 changed files with 19 additions and 12 deletions

View File

@ -7,7 +7,7 @@ use Zend\Stratigility\MiddlewarePipe;
// Instantiate the application, register providers etc. // Instantiate the application, register providers etc.
$app = require __DIR__.'/flarum/bootstrap.php'; $app = require __DIR__.'/flarum/bootstrap.php';
// Set up everything we need for the frontend if ($app->bound('flarum.config')) {
$app->register('Flarum\Forum\ForumServiceProvider'); $app->register('Flarum\Forum\ForumServiceProvider');
// Build a middleware pipeline for Flarum // Build a middleware pipeline for Flarum
@ -24,6 +24,13 @@ if (Core::inDebugMode()) {
} else { } else {
$flarum->pipe(new \Flarum\Forum\Middleware\HandleErrors(base_path('error'))); $flarum->pipe(new \Flarum\Forum\Middleware\HandleErrors(base_path('error')));
} }
} else {
$app->register('Flarum\Install\InstallServiceProvider');
$flarum = new MiddlewarePipe();
$flarum->pipe('/', $app->make('Flarum\Http\RouterMiddleware', ['routes' => $app->make('flarum.install.routes')]));
$flarum->pipe(new \Franzl\Middleware\Whoops\Middleware());
}
$server = Server::createServer( $server = Server::createServer(
$flarum, $flarum,