ClassLoader::register( bool $prepend = false )

Registers this instance as an autoloader.


Parameters Parameters

$prepend

(Optional) Whether to prepend the autoloader or not

Default value: false


Source Source

File: vendor/composer/ClassLoader.php

    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;
        }
    }