From a08a8c44cd004f11a4eff53ce9c722b1eb8b184b Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Sun, 18 Jun 2017 11:02:07 +0200 Subject: [PATCH] fix variable being overwritten --- performance.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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); // ...