web/app_dev.php line 38

Open in your IDE?
  1. <?php
  2. use Symfony\Component\HttpFoundation\Request;
  3. use Symfony\Component\Debug\Debug;
  4. ini_set('memory_limit''-1');
  5. // If you don't want to setup permissions the proper way, just uncomment the following PHP line
  6. // read http://symfony.com/doc/current/book/installation.html#checking-symfony-application-configuration-and-setup
  7. // for more information
  8. //umask(0000);
  9. // This check prevents access to debug front controllers that are deployed by accident to production servers.
  10. // Feel free to remove this, extend it, or make something more sophisticated.
  11. if (isset($_SERVER['HTTP_CLIENT_IP'])
  12.     || isset($_SERVER['HTTP_X_FORWARDED_FOR'])
  13.     || !(in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1''fe80::1''::1')) || php_sapi_name() === 'cli-server')
  14. ) {
  15.     //header('HTTP/1.0 403 Forbidden');
  16.     //exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');
  17. }
  18. require_once __DIR__.'/../app/config/bootstrap.php';
  19. Debug::enable();
  20. error_reporting(E_ALL E_WARNING E_DEPRECATED);
  21. header('Access-Control-Allow-Origin: *');
  22. header("Access-Control-Allow-Headers: X-API-KEY, Origin, X-Requested-With, Content-Type, Accept, Access-Control-Request-Method, Authorization");
  23. header("Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, DELETE");
  24. header("Allow: GET, POST, OPTIONS, PUT, DELETE");
  25. $method $_SERVER['REQUEST_METHOD'];
  26. if ($method == "OPTIONS") {
  27.     die();
  28. }
  29. $kernel = new AppKernel('dev'true);
  30. $kernel->loadClassCache();
  31. $request Request::createFromGlobals();
  32. $response $kernel->handle($request);
  33. $response->send();
  34. $kernel->terminate($request$response);