app.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. //require_once __DIR__.'/../app/AppCache.php';
  20. require_once __DIR__.'/legacy.php';
  21. $kernel = new AppKernel('prod', false);
  22. $kernel->loadClassCache();
  23. //$kernel = new AppCache($kernel);
  24. // When using the HttpCache, you need to call the method in your front controller instead of relying on the configuration parameter
  25. Request::enableHttpMethodParameterOverride();
  26. $request = Request::createFromGlobals();
  27. $response = $kernel->handle($request);
  28. $response->send();
  29. $kernel->terminate($request, $response);