public/index.php line 40

Open in your IDE?
  1. <?php
  2. use App\Kernel;
  3. use App\LegacyBridge;
  4. use Symfony\Component\Dotenv\Dotenv;
  5. use Symfony\Component\ErrorHandler\Debug;
  6. use Symfony\Component\HttpFoundation\Request;
  7. require dirname(__DIR__) . '/vendor/autoload.php';
  8. (new Dotenv())->bootEnv(dirname(__DIR__) . '/.env');
  9. /*
  10.  * The kernel will always be available globally, allowing you to
  11.  * access it from your existing application and through it the
  12.  * service container. This allows for introducing new features in
  13.  * the existing application.
  14.  */
  15. global $kernel;
  16. if ($_SERVER['APP_DEBUG']) {
  17.     umask(0000);
  18.     Debug::enable();
  19. }
  20. if ($trustedProxies $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {
  21.     Request::setTrustedProxies(
  22.         explode(','$trustedProxies),
  23.         Request::HEADER_X_FORWARDED_FOR Request::HEADER_X_FORWARDED_PORT Request::HEADER_X_FORWARDED_PROTO
  24.     );
  25. }
  26. if ($trustedHosts $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {
  27.     Request::setTrustedHosts([$trustedHosts]);
  28. }
  29. $kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
  30. $request Request::createFromGlobals();
  31. $response $kernel->handle($request);
  32. /*
  33.  * LegacyBridge will take care of figuring out whether to boot up the
  34.  * existing application or to send the Symfony response back to the client.
  35.  */
  36. $scriptFile LegacyBridge::prepareLegacyScript($request$response__DIR__);
  37. if ($scriptFile !== null) {
  38.     require $scriptFile;
  39. } else {
  40.     $response->send();
  41. }
  42. $kernel->terminate($request$response);
  43. // use App\Kernel;
  44. // require_once dirname(__DIR__) . '/vendor/autoload_runtime.php';
  45. // return function (array $context) {
  46. //     return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
  47. // };