app_dev.php 918 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. ini_set('date.timezone', 'UTC');
  3. use Symfony\Component\HttpFoundation\Request;
  4. // This check prevents access to debug front controllers that are deployed by accident to production servers.
  5. // Feel free to remove this, extend it, or make something more sophisticated.
  6. if (isset($_SERVER['HTTP_CLIENT_IP'])
  7. || isset($_SERVER['HTTP_X_FORWARDED_FOR'])
  8. || !in_array(@$_SERVER['REMOTE_ADDR'], array(
  9. '127.0.0.1',
  10. '::1',
  11. ))
  12. ) {
  13. header('HTTP/1.0 403 Forbidden');
  14. exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');
  15. }
  16. $loader = require_once __DIR__.'/../app/bootstrap.php.cache';
  17. require_once __DIR__.'/../app/AppKernel.php';
  18. $kernel = new AppKernel('dev', true);
  19. $kernel->loadClassCache();
  20. $request = Request::createFromGlobals();
  21. $response = $kernel->handle($request);
  22. $response->send();
  23. $kernel->terminate($request, $response);