app.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  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. $kernel = new AppKernel('prod', false);
  20. $kernel->loadClassCache();
  21. $request = Sonata\PageBundle\Request\RequestFactory::createFromGlobals(
  22. 'host_with_path'
  23. );
  24. $response = $kernel->handle($request);
  25. $response->send();
  26. $kernel->terminate($request, $response);