Allow forum to be taken offline via config

This commit is contained in:
Toby Zerner 2015-12-03 17:56:27 +10:30
parent 67e9e23df1
commit 094ad74abc
2 changed files with 2 additions and 2 deletions

View File

@ -34,7 +34,7 @@ class Server extends AbstractServer
$pipe->pipe($basePath, $app->make('Flarum\Http\Middleware\DispatchRoute', ['routes' => $app->make('flarum.install.routes')]));
$pipe->pipe($basePath, new HandleErrors($errorDir, true));
} elseif ($app->isUpToDate()) {
} elseif ($app->isUpToDate() && ! $app->isDownForMaintenance()) {
$pipe->pipe($basePath, $app->make('Flarum\Http\Middleware\ParseJsonBody'));
$pipe->pipe($basePath, $app->make('Flarum\Http\Middleware\AuthenticateWithCookie'));
$pipe->pipe($basePath, $app->make('Flarum\Http\Middleware\StartSession'));

View File

@ -611,7 +611,7 @@ class Application extends Container implements ApplicationContract
*/
public function isDownForMaintenance()
{
return false;
return $this->config('offline');
}
/**