From db84803b82275fc482e7e859cfcbc1fe45265c95 Mon Sep 17 00:00:00 2001 From: tracer Date: Mon, 11 Apr 2022 17:56:59 +0200 Subject: [PATCH] refactored --- public/index.php | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/public/index.php b/public/index.php index 3bcee0b..9982c21 100644 --- a/public/index.php +++ b/public/index.php @@ -1,22 +1,9 @@ bootEnv(dirname(__DIR__).'/.env'); - -if ($_SERVER['APP_DEBUG']) { - umask(0000); - - Debug::enable(); -} - -$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']); -$request = Request::createFromGlobals(); -$response = $kernel->handle($request); -$response->send(); -$kernel->terminate($request, $response); +return function (array $context) { + return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']); +};