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. $ips = array(  '37.25.72.175''86.242.18.175''92.154.63.183''2a01:e0a:16d:ef50:90:a1e:e2a1:2ff''2a01:cb00:37:a200:b599:3986:de11:b6a2''2a01:e0a:16d:ef50:41b1:8d79:1696:ecd1');
  7. //bureauxDan : '90.63.226.239'
  8. $localIP $_SERVER['REMOTE_ADDR'];
  9. if ($_SERVER['APP_DEBUG']) {
  10.     umask(0000);
  11.     Debug::enable();
  12. }
  13. if ($trustedProxies $_SERVER['TRUSTED_PROXIES'] ?? $_ENV['TRUSTED_PROXIES'] ?? false) {
  14.     Request::setTrustedProxies(explode(',',
  15.   ), Request::HEADER_X_FORWARDED_ALL Request::HEADER_X_FORWARDED_HOST);
  16. }
  17. if ($trustedHosts $_SERVER['TRUSTED_HOSTS'] ?? $_ENV['TRUSTED_HOSTS'] ?? false) {
  18.     Request::setTrustedHosts([$trustedHosts]);
  19. }
  20. if (in_array($localIP$ips)) {
  21.   $_SERVER['APP_ENV'] = 'dev';
  22.   $_SERVER['APP_DEBUG'] = '1';
  23.   $kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
  24. }else{
  25.   $kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
  26. }
  27. $request Request::createFromGlobals();
  28. $response $kernel->handle($request);
  29. $response->send();
  30. $kernel->terminate($request$response);