app_test.php 878 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. if (!in_array(@$_SERVER['REMOTE_ADDR'], array(
  3. '127.0.0.1',
  4. '172.33.33.1',
  5. '::1',
  6. '10.0.0.1'
  7. ))) {
  8. header('HTTP/1.0 403 Forbidden');
  9. exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');
  10. }
  11. $loader = require_once __DIR__.'/../app/bootstrap.php.cache';
  12. // Require kernel.
  13. require_once __DIR__.'/../app/AppKernel.php';
  14. require_once __DIR__.'/legacy.php';
  15. /*$request = Request::createFromGlobals();
  16. Request::enableHttpMethodParameterOverride();*/
  17. use Sonata\PageBundle\Request\RequestFactory;
  18. $request = RequestFactory::createFromGlobals('host_with_path_by_locale');
  19. $request->enableHttpMethodParameterOverride();
  20. // Initialize kernel and run the application.
  21. $kernel = new AppKernel('test', true);
  22. $response = $kernel->handle($request);
  23. $response->send();
  24. $kernel->terminate($request, $response);