abstract class AbstractClassLoader in X Autoload 7.4
Same name and namespace in other branches
- 7.5 src/ClassLoader/AbstractClassLoader.php \Drupal\xautoload\ClassLoader\AbstractClassLoader
Behaves mostly like the Symfony ClassLoader classes.
Hierarchy
- class \Drupal\xautoload\ClassLoader\AbstractClassLoader implements ClassLoaderInterface
Expanded class hierarchy of AbstractClassLoader
2 files declare their use of AbstractClassLoader
- ClassFinder.php in lib/
ClassFinder/ ClassFinder.php - ProxyClassFinder.php in lib/
ClassFinder/ ProxyClassFinder.php
File
- lib/
ClassLoader/ AbstractClassLoader.php, line 8
Namespace
Drupal\xautoload\ClassLoaderView source
abstract class AbstractClassLoader implements ClassLoaderInterface {
/**
* Registers this instance as an autoloader.
*
* @param boolean $prepend
* If TRUE, the loader will be prepended. Otherwise, it will be appended.
*/
function register($prepend = FALSE) {
// http://www.php.net/manual/de/function.spl-autoload-register.php#107362
// "when specifying the third parameter (prepend), the function will fail badly in PHP 5.2"
if (version_compare(PHP_VERSION, '5.3.0') >= 0) {
spl_autoload_register(array(
$this,
'loadClass',
), TRUE, $prepend);
}
elseif ($prepend) {
$loaders = spl_autoload_functions();
spl_autoload_register(array(
$this,
'loadClass',
));
foreach ($loaders as $loader) {
spl_autoload_unregister($loader);
spl_autoload_register($loader);
}
}
else {
spl_autoload_register(array(
$this,
'loadClass',
));
}
}
/**
* Unregister from the spl autoload stack.
*/
function unregister() {
spl_autoload_unregister(array(
$this,
'loadClass',
));
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AbstractClassLoader:: |
function |
Registers this instance as an autoloader. Overrides ClassLoaderInterface:: |
||
AbstractClassLoader:: |
function |
Unregister from the spl autoload stack. Overrides ClassLoaderInterface:: |
||
ClassLoaderInterface:: |
function | Callback for class loading. This will include ("require") the file found. | 3 |