From 7906660a9b9dc3b394d8087ab9d6888a7830c786 Mon Sep 17 00:00:00 2001 From: Daniel Klabbers Date: Fri, 11 Jun 2021 10:26:25 +0200 Subject: [PATCH] allows replacing maintenance mode handler using ioc --- framework/core/src/Foundation/InstalledApp.php | 2 +- framework/core/src/Foundation/InstalledSite.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/framework/core/src/Foundation/InstalledApp.php b/framework/core/src/Foundation/InstalledApp.php index a7d0f88b5..e087aa3ee 100644 --- a/framework/core/src/Foundation/InstalledApp.php +++ b/framework/core/src/Foundation/InstalledApp.php @@ -48,7 +48,7 @@ class InstalledApp implements AppInterface public function getRequestHandler() { if ($this->config->inMaintenanceMode()) { - return new MaintenanceModeHandler(); + return $this->container->make('flarum.maintenance.handler'); } elseif ($this->needsUpdate()) { return $this->getUpdaterHandler(); } diff --git a/framework/core/src/Foundation/InstalledSite.php b/framework/core/src/Foundation/InstalledSite.php index a02a44d3a..b703f351f 100644 --- a/framework/core/src/Foundation/InstalledSite.php +++ b/framework/core/src/Foundation/InstalledSite.php @@ -105,6 +105,7 @@ class InstalledSite implements SiteInterface $container->alias('flarum.config', Config::class); $container->instance('flarum.debug', $this->config->inDebugMode()); $container->instance('config', $config = $this->getIlluminateConfig($laravel)); + $container->instance('flarum.maintenance.handler', new MaintenanceModeHandler); $this->registerLogger($container); $this->registerCache($container);