diff --git a/public/index.php b/public/index.php index 977ccf446..198ffe240 100644 --- a/public/index.php +++ b/public/index.php @@ -1,73 +1,14 @@ init(); - -global $legacyRoute; - -$legacyRoute = $kernel->getLegacyRoute($request); - -if (!empty($legacyRoute)) { - - $path = './legacy'; - if (!empty($legacyRoute['dir'])) { - $path .= '/' . $legacyRoute['dir']; - } - - chdir($path); - - $access = $legacyRoute['access'] ?? false; - if ($access === false) { - http_response_code(404); - exit; - } - - if (file_exists($legacyRoute['file'])) { - - /* @noinspection PhpIncludeInspection */ - require './' . $legacyRoute['file']; - } else { - - http_response_code(404); - exit; - } - -} else { - $kernel->configureGraphqlIntrospection(); - $response = $kernel->handle($request); - $response->send(); - $kernel->terminate($request, $response); -} +return function (array $context) { + return new Kernel($context['APP_ENV'], (bool)$context['APP_DEBUG']); +};