protected function xautoload_LoaderManager::switchLoaderMode in X Autoload 7.3
Change the loader mode.
Parameters
string $mode: Loader mode, e.g. 'apc' or 'default'.
boolean $prepend: If TRUE, the loader will be prepended before other loaders. If FALSE, the loader will be inserted into the dedicated position between other loaders.
1 call to xautoload_LoaderManager::switchLoaderMode()
- xautoload_LoaderManager::register in lib/
LoaderManager.php - Register the loader for the given mode, and unregister other loaders. This can be used both for initial registration, and later on to change the cache mode.
File
- lib/
LoaderManager.php, line 108
Class
- xautoload_LoaderManager
- This thing has an overview of available class loaders with different cache mechanics. It can detect the currently applicable cache method, and it can switch between cache methods.
Code
protected function switchLoaderMode($mode, $prepend) {
if ($mode === $this->mode && !$prepend) {
return;
}
if (isset($this->loaders[$this->mode])) {
// Unregister the original loader.
$this->loaders[$this->mode]
->unregister();
}
$this
->registerLoader($this->loaders[$mode], $prepend);
$this->mode = $mode;
}