allows replacing maintenance mode handler using ioc

This commit is contained in:
Daniel Klabbers 2021-06-11 10:26:25 +02:00 committed by Daniël Klabbers
parent a0152ffb18
commit 4acff91f80
2 changed files with 2 additions and 1 deletions

View File

@ -48,7 +48,7 @@ class InstalledApp implements AppInterface
public function getRequestHandler() public function getRequestHandler()
{ {
if ($this->config->inMaintenanceMode()) { if ($this->config->inMaintenanceMode()) {
return new MaintenanceModeHandler(); return $this->container->make('flarum.maintenance.handler');
} elseif ($this->needsUpdate()) { } elseif ($this->needsUpdate()) {
return $this->getUpdaterHandler(); return $this->getUpdaterHandler();
} }

View File

@ -105,6 +105,7 @@ class InstalledSite implements SiteInterface
$container->alias('flarum.config', Config::class); $container->alias('flarum.config', Config::class);
$container->instance('flarum.debug', $this->config->inDebugMode()); $container->instance('flarum.debug', $this->config->inDebugMode());
$container->instance('config', $config = $this->getIlluminateConfig($laravel)); $container->instance('config', $config = $this->getIlluminateConfig($laravel));
$container->instance('flarum.maintenance.handler', new MaintenanceModeHandler);
$this->registerLogger($container); $this->registerLogger($container);
$this->registerCache($container); $this->registerCache($container);