public/index.php line 40

Open in your IDE?
  1. <?php
  2. use Symfony\Component\ErrorHandler\Debug;
  3. use Symfony\Component\HttpFoundation\Request;
  4. // If you don't want to setup permissions the proper way, just uncomment the following PHP line
  5. // read https://symfony.com/doc/current/setup.html#checking-symfony-application-configuration-and-setup
  6. // for more information
  7. //umask(0000);
  8. header("Cache-Control: no-store, must-revalidate, max-age=0");
  9. header("Pragma: no-cache");
  10. header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
  11. // This check prevents access to debug front
  12. //controllers that are deployed by accident to production servers. //phpcs:ignore
  13. // Feel free to remove this, extend it, or make something more sophisticated.
  14. if (
  15.     isset($_SERVER['HTTP_CLIENT_IP'])
  16.     || isset($_SERVER['HTTP_X_FORWARDED_FOR'])
  17.     || !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1''::1'], true) || PHP_SAPI === 'cli-server'//phpcs:ignore
  18. ) {
  19.     header('HTTP/1.0 403 Forbidden');
  20.    // exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');//phpcs:ignore
  21. }
  22. require __DIR__ '/../vendor/autoload.php';
  23. $dotenv = new \Symfony\Component\Dotenv\Dotenv();
  24. $dotenv->load(dirname(__DIR__) . "/.env");
  25. // Debug::enable();
  26. $kernel = new Kernel('dev'true);
  27. if (PHP_VERSION_ID 70000) {
  28.     $kernel->loadClassCache();
  29. }
  30. $request Request::createFromGlobals();
  31. $response $kernel->handle($request);
  32. $response->send();
  33. $kernel->terminate($request$response);