From 54ecd48b722933c4bb0a32d81aeaecdc5699a8f6 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Wed, 20 Dec 2017 00:00:23 +0100 Subject: [PATCH] Disable HandleErrors middleware during installation Temporary measure until we have a real fix in place. --- framework/core/src/Http/Server.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/framework/core/src/Http/Server.php b/framework/core/src/Http/Server.php index 590a73a24..8c50cb3e2 100644 --- a/framework/core/src/Http/Server.php +++ b/framework/core/src/Http/Server.php @@ -67,6 +67,7 @@ class Server */ public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $out) { + // FIXME: Only call this when app is installed. Do this via middleware? $this->collectGarbage(); $middleware = $this->getMiddleware($request->getUri()->getPath()); @@ -119,8 +120,10 @@ class Server { $this->app->register(InstallServiceProvider::class); - $pipe->pipe(new HandleErrors($this->getErrorDir(), $this->app->make('log'), true)); - + // FIXME: Re-enable HandleErrors middleware, if possible + // (Right now it tries to resolve a database connection because of the injected settings repo instance) + // We could register a different settings repo when Flarum is not installed + //$pipe->pipe($this->app->make(HandleErrors::class, ['debug' => true])); $pipe->pipe($this->app->make(StartSession::class)); $pipe->pipe($this->app->make(DispatchRoute::class, ['routes' => $this->app->make('flarum.install.routes')]));