diff --git a/performance.rst b/performance.rst index 67bd1989652..53caf406c87 100644 --- a/performance.rst +++ b/performance.rst @@ -71,21 +71,21 @@ Caching the Autoloader with APC Another solution is to cache the location of each class after it's located the first time. Symfony comes with a class - :class:`Symfony\\Component\\ClassLoader\\ApcClassLoader` - that does exactly this. To use it, just adapt your front controller file. -If you're using the Standard Distribution, this code should already be available -as comments in this file:: +If you're using the Standard Distribution, make the following changes:: // app.php // ... + + use Symfony\Component\ClassLoader\ApcClassLoader; - $loader = require_once __DIR__.'/../app/bootstrap.php.cache'; + $loader = require __DIR__.'/../app/autoload.php'; + include_once __DIR__.'/../app/bootstrap.php.cache'; // Use APC for autoloading to improve performance // Change 'sf2' by the prefix you want in order // to prevent key conflict with another application - /* $loader = new ApcClassLoader('sf2', $loader); $loader->register(true); - */ // ...