web/index.php line 5

Open in your IDE?
  1. <?php
  2. use App\Kernel;
  3. require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
  4. return function (array $context) {
  5.     return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
  6. };
  7. // use Symfony\Component\ErrorHandler\DebugClassLoader;
  8. // use Symfony\Component\HttpFoundation\Request;
  9. // use App\Kernel;
  10. // If you don't want to setup permissions the proper way, just uncomment the following PHP line
  11. // read https://symfony.com/doc/current/setup.html#checking-symfony-application-configuration-and-setup
  12. // for more information
  13. //umask(0000);
  14. // This check prevents access to debug front controllers that are deployed by accident to production servers.
  15. // Feel free to remove this, extend it, or make something more sophisticated.
  16. // commented out because htacces protection is activated
  17. /*
  18. const HOTWEB_IP = '87.147.32.25';
  19. if (isset($_SERVER['HTTP_CLIENT_IP'])
  20.     || isset($_SERVER['HTTP_X_FORWARDED_FOR'])
  21.     || !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1', HOTWEB_IP], true) || PHP_SAPI === 'cli-server')
  22. ) {
  23.     header('HTTP/1.0 403 Forbidden');
  24.     exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');
  25. }
  26. */
  27. // ip check
  28. // if you use ip areas make sure that a "." is always at the end of this area
  29. // for example the first three ip areas
  30. /*
  31. $ipAreas = [
  32.     '87.147.', '85.25.', '62.75.', '93.196', '83.221.241.207', '127.0.0.1', '::1', '94.223.'
  33. ];
  34. $validIp = false;
  35. foreach($ipAreas as $ipArea)
  36. {
  37.     $len = strlen($ipArea);
  38.     $remote = substr($_SERVER['REMOTE_ADDR'], 0, $len);
  39.     if($remote === $ipArea)
  40.     {
  41.         $validIp = true;
  42.     }
  43. }
  44. if(!$validIp)
  45. {
  46.     header('HTTP/1.0 403 Forbidden');
  47.     exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.'); 
  48. }
  49. */
  50. // require __DIR__.'/../vendor/autoload.php';
  51. // DebugClassLoader::enable();
  52. // date_default_timezone_set('Europe/Berlin');
  53. // $kernel = new Kernel('dev', true);
  54. // $request = Request::createFromGlobals();
  55. // $response = $kernel->handle($request);
  56. // $response->send();
  57. // $kernel->terminate($request, $response);