1
0
mirror of https://github.com/flarum/core.git synced 2025-08-07 00:47:00 +02:00

Lazily initialise the Application instance

See f403feb3b1
This commit is contained in:
Toby Zerner
2016-04-24 11:10:39 +09:30
parent 7bd3fa82b1
commit 3d812c287f
2 changed files with 10 additions and 4 deletions

View File

@@ -44,9 +44,11 @@ abstract class AbstractServer extends BaseAbstractServer
*/
public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $out = null)
{
$this->collectGarbage($this->app);
$app = $this->getApp();
$middleware = $this->getMiddleware($this->app);
$this->collectGarbage($app);
$middleware = $this->getMiddleware($app);
return $middleware($request, $response, $out);
}