From 094ad74abc698cf065fcdf9bbd6ccd18456484a6 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Thu, 3 Dec 2015 17:56:27 +1030 Subject: [PATCH] Allow forum to be taken offline via config --- src/Forum/Server.php | 2 +- src/Foundation/Application.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Forum/Server.php b/src/Forum/Server.php index 18df07f7b..49f3a5235 100644 --- a/src/Forum/Server.php +++ b/src/Forum/Server.php @@ -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')); diff --git a/src/Foundation/Application.php b/src/Foundation/Application.php index 0571fa722..7b18af206 100644 --- a/src/Foundation/Application.php +++ b/src/Foundation/Application.php @@ -611,7 +611,7 @@ class Application extends Container implements ApplicationContract */ public function isDownForMaintenance() { - return false; + return $this->config('offline'); } /**