public/index.php line 40

Open in your IDE?
  1. <?php
  2. use App\Kernel;
  3. use Symfony\Component\ErrorHandler\Debug;
  4. use Symfony\Component\HttpFoundation\Request;
  5. require dirname(__DIR__).'/config/bootstrap.php';
  6. if ($_SERVER['APP_DEBUG']) {
  7.     umask(0000);
  8.     Debug::enable();
  9. }
  10. if (isset($_SERVER['HTTP_X_PROXIED_HOST'])) {
  11.     $_SERVER['HTTP_X_FORWARDED_HOST'] = $_SERVER['HTTP_X_PROXIED_HOST'];
  12.     $_SERVER['TRUSTED_PROXIES'] = '127.0.0.1,REMOTE_ADDR';
  13. }
  14. if ($trustedProxies $_SERVER['TRUSTED_PROXIES'] ?? false) {
  15.     Request::setTrustedProxies(
  16.         explode(','$trustedProxies),
  17.         Request::HEADER_X_FORWARDED_ALL
  18.     );
  19. }
  20. if ($trustedHosts $_SERVER['TRUSTED_HOSTS'] ?? false) {
  21.     Request::setTrustedHosts([$trustedHosts]);
  22. }
  23. $kernel = new Kernel(
  24.     $_SERVER['APP_ENV'],
  25.     (bool) $_SERVER['APP_DEBUG'],
  26.     (bool) $_SERVER['ENABLED_FEATURE_PDB'],
  27.     (bool) $_SERVER['ENABLED_FEATURE_PRESS_SITE'],
  28.     (bool) $_SERVER['ENABLED_FEATURE_OPERATOR_API'],
  29.     $_SERVER['CACHE_METADATA_PATH_OVERRIDE']
  30. );
  31. $request Request::createFromGlobals();
  32. $response $kernel->handle($request);
  33. $response->send();
  34. $kernel->terminate($request$response);