app_dev.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. // If you don't want to setup permissions the proper way, just uncomment the following PHP line
  3. // read http://symfony.com/doc/current/book/installation.html#configuration-and-setup for more information
  4. umask(0000);
  5. // This check prevents access to debug front controllers that are deployed by accident to production servers.
  6. // Feel free to remove this, extend it, or make something more sophisticated.
  7. if (isset($_SERVER['HTTP_CLIENT_IP'])
  8. || isset($_SERVER['HTTP_X_FORWARDED_FOR'])
  9. || !in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', 'fe80::1', '::1'))
  10. ) {
  11. header('HTTP/1.0 403 Forbidden');
  12. exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');
  13. }
  14. require_once __DIR__.'/../app/bootstrap.php.cache';
  15. require_once __DIR__.'/../app/AppKernel.php';
  16. require_once __DIR__.'/legacy.php';
  17. // if you want to use the SonataPageBundle with multisite
  18. // using different relative paths, you must change the request
  19. // object to use the SiteRequest
  20. //$request = Request::createFromGlobals('host_with_path');
  21. /*use Symfony\Component\HttpFoundation\Request;
  22. Request::enableHttpMethodParameterOverride();
  23. $request = Request::createFromGlobals();*/
  24. use Sonata\PageBundle\Request\RequestFactory;
  25. $request = RequestFactory::createFromGlobals('host_with_path_by_locale');
  26. $request->enableHttpMethodParameterOverride();
  27. $kernel = new AppKernel('dev', true);
  28. $response = $kernel->handle($request);
  29. $response->send();
  30. $kernel->terminate($request, $response);