Skip to content

Commit

Permalink
allows replacing maintenance mode handler using ioc
Browse files Browse the repository at this point in the history
  • Loading branch information
luceos committed Jun 21, 2021
1 parent a0152ff commit 4acff91
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Foundation/InstalledApp.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function getContainer()
public function getRequestHandler()
{
if ($this->config->inMaintenanceMode()) {
return new MaintenanceModeHandler();
return $this->container->make('flarum.maintenance.handler');
} elseif ($this->needsUpdate()) {
return $this->getUpdaterHandler();
}
Expand Down
1 change: 1 addition & 0 deletions src/Foundation/InstalledSite.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ protected function bootLaravel(): Container
$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);
Expand Down

0 comments on commit 4acff91

Please sign in to comment.