public/index.php line 31

Open in your IDE?
  1. <?php
  2. use App\CacheKernel;
  3. use App\Kernel;
  4. use Symfony\Component\ErrorHandler\Debug;
  5. use Symfony\Component\HttpFoundation\Request;
  6. require dirname(__DIR__).'/config/bootstrap.php';
  7. // if ($_SERVER['APP_DEBUG']) {
  8. //     umask(0000);
  9. //     Debug::enable();
  10. // }
  11. if ($trustedProxies $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {
  12.     Request::setTrustedProxies(explode(','$trustedProxies), Request::HEADER_X_FORWARDED_ALL Request::HEADER_X_FORWARDED_HOST);
  13. }
  14. if ($trustedHosts $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {
  15.     Request::setTrustedHosts([$trustedHosts]);
  16. }
  17. $kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
  18. // Wrap the default Kernel with the CacheKernel one in 'prod' environment
  19. if ('prod' === $kernel->getEnvironment()) {
  20.     $kernel = new CacheKernel($kernel);
  21. }
  22. $request Request::createFromGlobals();
  23. $response $kernel->handle($request);
  24. $response->send();
  25. $kernel->terminate($request$response);