app_dev.php 1.2 KB

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