app_test.php 1.1KB

123456789101112131415161718192021222324252627282930
  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(
  11. '127.0.0.1',
  12. '::1',
  13. ))
  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. $loader = require_once __DIR__.'/../app/bootstrap.php.cache';
  19. require_once __DIR__.'/../app/AppKernel.php';
  20. $kernel = new AppKernel('test', true);
  21. $kernel->loadClassCache();
  22. $request = Request::createFromGlobals();
  23. $response = $kernel->handle($request);
  24. $response->send();
  25. $kernel->terminate($request, $response);