app_dev.php 1.1KB

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