diff --git a/performance.rst b/performance.rst index 5dc175d01f6..63b935aff8b 100644 --- a/performance.rst +++ b/performance.rst @@ -138,13 +138,15 @@ If you're using the Standard Distribution, make the following changes:: use Symfony\Component\ClassLoader\ApcClassLoader; - $loader = require __DIR__.'/../app/autoload.php'; + // do not use $loader as a variable name here as it would + // be overwritten when loading the bootstrap.php.cache file + $classLoader = 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 = new ApcClassLoader('sf2', $classLoader); $loader->register(true); // ...