app.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. //use Symfony\Component\ClassLoader\ApcClassLoader;
  3. //use Symfony\Component\HttpFoundation\Request;
  4. // If you don't want to setup permissions the proper way, just uncomment the following PHP line
  5. // read http://symfony.com/doc/current/book/installation.html#configuration-and-setup for more information
  6. umask(0000);
  7. $loader = require __DIR__.'/../app/autoload.php';
  8. include_once __DIR__.'/../app/bootstrap.php.cache';
  9. // Enable APC for autoloading to improve performance.
  10. // You should change the ApcClassLoader first argument to a unique prefix
  11. // in order to prevent cache key conflicts with other applications
  12. // also using APC.
  13. /*
  14. $apcLoader = new ApcClassLoader(sha1(__FILE__), $loader);
  15. $loader->unregister();
  16. $apcLoader->register(true);
  17. */
  18. require_once __DIR__.'/../app/AppKernel.php';
  19. $request = Sonata\PageBundle\Request\RequestFactory::createFromGlobals(
  20. 'host_with_path_by_locale'
  21. );
  22. $kernel = new AppKernel('prod', false);
  23. $response = $kernel->handle($request);
  24. $response->send();
  25. $kernel->terminate($request, $response);