Skip to content

Commit 55a7676

Browse files
committed
Generate an APC prefix based on __FILE__
Relates to https://github.com/symfony/symfony-standard/issues/654
1 parent f1a79e2 commit 55a7676

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

components/class_loader/cache_class_loader.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ ApcClassLoader
3434
// instance of a class that implements a findFile() method, like the ClassLoader
3535
$loader = ...;
3636
37-
// my_prefix is the APC namespace prefix to use
38-
$cachedLoader = new ApcClassLoader('my_prefix', $loader);
37+
// sha1(__FILE__) generates an APC namespace prefix
38+
$cachedLoader = new ApcClassLoader(sha1(__FILE__), $loader);
3939
4040
// register the cached class loader
4141
$cachedLoader->register();
@@ -54,8 +54,8 @@ it is straightforward::
5454
// instance of a class that implements a findFile() method, like the ClassLoader
5555
$loader = ...;
5656
57-
// my_prefix is the XCache namespace
58-
$cachedLoader = new XcacheClassLoader('my_prefix', $loader);
57+
// sha1(__FILE__) generates an XCache namespace prefix
58+
$cachedLoader = new XcacheClassLoader(sha1(__FILE__), $loader);
5959
6060
// register the cached class loader
6161
$cachedLoader->register();

0 commit comments

Comments
 (0)