WinCacheClassLoader
class WinCacheClassLoader
WinCacheClassLoader implements a wrapping autoloader cached in WinCache.
It expects an object implementing a findFile method to find the file. This allow 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 WinCacheClassLoader('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();
Methods
Constructor.
Registers this instance as an autoloader.
Unregisters this instance as an autoloader.
Loads the given class or interface.
Finds a file by class name while caching lookups to WinCache.
Passes through all unknown calls onto the decorated object.
Details
at line line 62
__construct(string $prefix, object $decorated)
Constructor.
at line line 81
register(Boolean $prepend = false)
Registers this instance as an autoloader.
at line line 89
unregister()
Unregisters this instance as an autoloader.
at line line 101
Boolean|null
loadClass(string $class)
Loads the given class or interface.
at line line 117
string|null
findFile(string $class)
Finds a file by class name while caching lookups to WinCache.
at line line 129
__call($method, $args)
Passes through all unknown calls onto the decorated object.