Skip to content

Commit

Permalink
Generate an APC prefix based on __FILE__
Browse files Browse the repository at this point in the history
  • Loading branch information
trsteel88 authored and weaverryan committed May 15, 2014
1 parent 4211bff commit 918e9c2
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 918e9c2

Please sign in to comment.