mirror of https://github.com/flarum/flarum
Load installer if not installed
parent
5a7d97baf8
commit
718c2e053d
|
@ -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,
|
||||||
|
|
Loading…
Reference in New Issue