mirror of
https://github.com/flarum/framework.git
synced 2024-11-29 12:43:52 +08:00
allows replacing maintenance mode handler using ioc
This commit is contained in:
parent
79abf87e8c
commit
7906660a9b
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user