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 79abf87e8c
commit 7906660a9b
2 changed files with 2 additions and 1 deletions

View File

@ -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();
}

View File

@ -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);