Composer\Autoload
ClassLoader::register()
Registers this instance as an autoloader.
Method of the class: ClassLoader{}
No Hooks.
Return
null
. Nothing (null).
Usage
$ClassLoader = new ClassLoader(); $ClassLoader->register( $prepend );
- $prepend(true|false)
- Whether to prepend the autoloader or not
Default: false
ClassLoader::register() ClassLoader::register code WPSCache 1.12.4
public function register($prepend = false) { spl_autoload_register(array($this, 'loadClass'), true, $prepend); if (null === $this->vendorDir) { return; } if ($prepend) { self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; } else { unset(self::$registeredLoaders[$this->vendorDir]); self::$registeredLoaders[$this->vendorDir] = $this; } }