app_dev.php 1.1 KB

12345678910111213141516171819202122232425262728
  1. <?php
  2. use Symfony\Component\HttpFoundation\Request;
  3. // If you don't want to setup permissions the proper way, just uncomment the following PHP line
  4. // read http://symfony.com/doc/current/book/installation.html#configuration-and-setup for more information
  5. //umask(0000);
  6. // This check prevents access to debug front controllers that are deployed by accident to production servers.
  7. // Feel free to remove this, extend it, or make something more sophisticated.
  8. if (isset($_SERVER['HTTP_CLIENT_IP'])
  9. || isset($_SERVER['HTTP_X_FORWARDED_FOR'])
  10. || !in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', 'fe80::1', '::1'))
  11. ) {
  12. header('HTTP/1.0 403 Forbidden');
  13. exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');
  14. }
  15. $loader = require_once __DIR__.'/../app/bootstrap.php.cache';
  16. require_once __DIR__.'/../app/AppKernel.php';
  17. $kernel = new AppKernel('dev', true);
  18. $kernel->loadClassCache();
  19. Request::enableHttpMethodParameterOverride();
  20. $request = Request::createFromGlobals();
  21. $response = $kernel->handle($request);
  22. $response->send();
  23. $kernel->terminate($request, $response);