Skip to content

Commit 4127ad9

Browse files
Update performance.rst
The example provided under "Caching the Autoloader with APC" is not in sync with the content of the 'app.php' file in Symfony 2.8: * the comment hint was removed in #964 * the autoloader was extracted from bootstrap: symfony/symfony-standard@747a384
1 parent f17e4fe commit 4127ad9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

performance.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,21 +71,21 @@ Caching the Autoloader with APC
7171
Another solution is to cache the location of each class after it's located
7272
the first time. Symfony comes with a class - :class:`Symfony\\Component\\ClassLoader\\ApcClassLoader` -
7373
that does exactly this. To use it, just adapt your front controller file.
74-
If you're using the Standard Distribution, this code should already be available
75-
as comments in this file::
74+
If you're using the Standard Distribution, make the following changes::
7675

7776
// app.php
7877
// ...
78+
79+
use Symfony\Component\ClassLoader\ApcClassLoader;
7980

80-
$loader = require_once __DIR__.'/../app/bootstrap.php.cache';
81+
$loader = require __DIR__.'/../app/autoload.php';
82+
include_once __DIR__.'/../app/bootstrap.php.cache';
8183

8284
// Use APC for autoloading to improve performance
8385
// Change 'sf2' by the prefix you want in order
8486
// to prevent key conflict with another application
85-
/*
8687
$loader = new ApcClassLoader('sf2', $loader);
8788
$loader->register(true);
88-
*/
8989

9090
// ...
9191

0 commit comments

Comments
 (0)