Skip to content

Commit

Permalink
bug #3830 Generate an APC prefix based on __FILE__ (trsteel88)
Browse files Browse the repository at this point in the history
This PR was submitted for the 2.4 branch but it was merged into the 2.3 branch instead (closes #3830).

Discussion
----------

Generate an APC prefix based on __FILE__

Relates to https://github.com/symfony/symfony-standard/issues/654

Commits
-------

55a7676 Generate an APC prefix based on __FILE__
  • Loading branch information
weaverryan committed May 15, 2014
2 parents 4211bff + 918e9c2 commit 4ed9a08
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions components/class_loader/cache_class_loader.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ ApcClassLoader
// instance of a class that implements a findFile() method, like the ClassLoader
$loader = ...;
// my_prefix is the APC namespace prefix to use
$cachedLoader = new ApcClassLoader('my_prefix', $loader);
// sha1(__FILE__) generates an APC namespace prefix
$cachedLoader = new ApcClassLoader(sha1(__FILE__), $loader);
// register the cached class loader
$cachedLoader->register();
Expand All @@ -60,8 +60,8 @@ it is straightforward::
// instance of a class that implements a findFile() method, like the ClassLoader
$loader = ...;
// my_prefix is the XCache namespace
$cachedLoader = new XcacheClassLoader('my_prefix', $loader);
// sha1(__FILE__) generates an XCache namespace prefix
$cachedLoader = new XcacheClassLoader(sha1(__FILE__), $loader);
// register the cached class loader
$cachedLoader->register();
Expand Down

0 comments on commit 4ed9a08

Please sign in to comment.