public/index.php line 75

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  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.     // https://github.com/symfony/symfony/issues/35575
  10.     $showDeprecations $_ENV['APP_CONSOLE_DEPRECATIONS'] ?? $_SERVER['APP_CONSOLE_DEPRECATIONS'] ?? false;
  11.     $showDeprecations filter_var($showDeprecations\FILTER_VALIDATE_BOOLEAN);
  12.     \App\Component\ErrorHandler\DebugErrorHandler::enable(false);
  13. }
  14. //if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
  15. //    $ip = $_SERVER['HTTP_CLIENT_IP'];
  16. //} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
  17. //    $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
  18. //} else {
  19. //    $ip = $_SERVER['REMOTE_ADDR'];
  20. //}
  21. ////echo $ip;
  22. //if($ip == "91.164.180.89" || $ip == "81.251.253.22" || $ip == "197.149.33.40"  || $ip == "91.175.47.123" || $ip == "146.247.88.170" || $ip =="154.126.87.131"){
  23. //
  24. //
  25. //}else{
  26. //
  27. //echo '<!doctype html>
  28. //<title>Site Maintenance</title>
  29. //<style>
  30. //  body { text-align: center; padding: 150px; }
  31. //  h1 { font-size: 50px; }
  32. //  body { font: 20px Helvetica, sans-serif; color: #333; }
  33. //  article { display: block; text-align: left; width: 650px; margin: 0 auto; }
  34. //  a { color: #dc8100; text-decoration: none; }
  35. //  a:hover { color: #333; text-decoration: none; }
  36. //</style>
  37. //
  38. //<article>
  39. //
  40. //    <h1>Le site est en maintenance </h1>
  41. //
  42. //    <div>
  43. //        <p> Le site est actuellement en maintenance. Lachouettemauve reviendra aux alentours de 15h30 ! </p>
  44. //        <p>&mdash; Lachouettemauve</p>
  45. //    </div>
  46. //</article>';
  47. //
  48. //exit;
  49. //}
  50. if ($trustedProxies $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {
  51.     Request::setTrustedProxies(explode(','$trustedProxies), Request::HEADER_X_FORWARDED_ALL Request::HEADER_X_FORWARDED_HOST);
  52. }
  53. if ($trustedHosts $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {
  54.     Request::setTrustedHosts([$trustedHosts]);
  55. }
  56. $kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
  57. $request Request::createFromGlobals();
  58. $response $kernel->handle($request);
  59. $response->send();
  60. $kernel->terminate($request$response);