XcacheClassLoader implements a wrapping autoloader cached in Xcache for PHP 5.3.
It expects an object implementing a findFile method to find the file. This allows using it as a wrapper around the other loaders of the component (the ClassLoader and the UniversalClassLoader for instance) but also around any other autoloader following this convention (the Composer one for instance)
$loader = new ClassLoader();
// register classes with namespaces $loader->add('Symfony\Component', __DIR__.'/component'); $loader->add('Symfony', __DIR__.'/framework');
$cachedLoader = new XcacheClassLoader('my_prefix', $loader);
// activate the cached autoloader $cachedLoader->register();
// eventually deactivate the non-cached loader if it was registered previously // to be sure to use the cached one. $loader->unregister();
@author Fabien Potencier <fabien@symfony.com> @author Kris Wallsmith <kris@symfony.com> @author Kim Hemsø Rasmussen <kimhemsoe@gmail.com>
@api
Expanded class hierarchy of XcacheClassLoader
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
XcacheClassLoader:: |
private | property | ||
XcacheClassLoader:: |
private | property | ||
XcacheClassLoader:: |
public | function | Finds a file by class name while caching lookups to Xcache. | |
XcacheClassLoader:: |
public | function | Loads the given class or interface. | |
XcacheClassLoader:: |
public | function | Registers this instance as an autoloader. | |
XcacheClassLoader:: |
public | function | Unregisters this instance as an autoloader. | |
XcacheClassLoader:: |
public | function | Constructor. |