app_dev.php 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. ini_set('date.timezone', 'UTC');
  3. use Composer\Autoload\ClassLoader;
  4. use Symfony\Component\HttpFoundation\Request;
  5. use Symfony\Component\Debug\Debug;
  6. // If you don't want to setup permissions the proper way, just uncomment the following PHP line
  7. // read http://symfony.com/doc/current/book/installation.html#configuration-and-setup 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'))
  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. /**
  19. * @var ClassLoader
  20. */
  21. $loader = require_once __DIR__.'/../app/autoload.php';
  22. Debug::enable();
  23. $kernel = new AppKernel('dev', true);
  24. $request = Request::createFromGlobals();
  25. $response = $kernel->handle($request);
  26. $response->send();
  27. $kernel->terminate($request, $response);