Registers a set of classes, merging with any others previously set.

@param string       $prefix   the classes prefix
@param array|string $paths    the location(s) of the classes
@param bool         $prepend  prepend the location(s)
5599
public function add($prefix, $paths, $prepend = false) {
		if (!$prefix) {
			if ($prepend) {
				$this->fallbackDirs = array_merge(
					(array) $paths,
					$this->fallbackDirs
				);
			}
			else {
				$this->fallbackDirs = array_merge(
					$this->fallbackDirs,
					(array) $paths
				);
			}

			return;
		}

		if (!isset($this->prefixes[$prefix])) {
			$this->prefixes[$prefix] = (array) $paths;
			return;
		}

		if ($prepend) {
			$this->prefixes[$prefix] = array_merge(
				(array) $paths,
				$this->prefixes[$prefix]
			);
		}
		else {
			$this->prefixes[$prefix] = array_merge(
				$this->prefixes[$prefix],
				(array) $paths
			);
		}
	}
1134494
public function registerNamespace($namespace, $path, $prepend = false) {
		if (! isset($namespace[0])) {
			require_once __DIR__ . '/Exceptions/InvalidNamespace.php';
			throw new InvalidNamespace('Namespace cannot be empty');
		}
		
		$definition = new stdClass();
		$definition->namespace = trim($namespace, '\ ');
		$definition->dirs      = new SplStack();
		
		if (is_array($path)) {
			foreach ($path as $dir) {
				$definition->dirs[] = $this->normalizePath($dir);
			}
		} else {
			$definition->dirs[] = $this->normalizePath($path);
		}
		
		if ($prepend) {
			$this->namespaces->shift($definition);
		} else {
			$this->namespaces[] = $definition;
		}
		
		return $this;
	}
284474
public function register($prepend = false)
    {
        if (!$this->isLoaded) {
            spl_autoload_register(array($this, 'loadClass'), true, $prepend);
        }
        $this->isLoaded = true;
    }
1197420
public function registerNamespaces(array $namespaces, $prepend = false) {
		foreach ($namespaces as $namespace => $path) {
			$this->registerNamespace($namespace, $path, $prepend);
		}
		
		return $this;
	}
1351001
public function registerMap($prefix, $library)
    {
        // check the structure of location if it contains metadata
        if (is_array($library)) {
            $path = $library['Path'];
            $this->rules[$prefix] = $library;
        } else {
            $path = $library;
        }

        $this->maps[$prefix] = $path;
    }
1112982
public function prepend($prefix): Utility
    {
        return new static(new static($prefix, $this->encoding) . $this->string, $this->encoding);
    }
749863
public function register_namespace( $namespace, $paths )
    {
        if ( isset( $this->namespaces[ $namespace ] ) )
        {
            $this->namespaces[ $namespace ] = array_merge(
                $this->namespaces[ $namespace ],
                (array) $paths
            );
        } 
        else 
        {
            $this->namespaces[ $namespace ] = (array) $paths;
            
            // Register PSR_0 as the first autoload filter for every namespace
            $this->register_autoload_filter( $namespace, array( $this, "PSR_0" ) );
        }
    }
1309798
public function register($placement = 'prepend')
	{
		$prepend = ($placement === 'append') ? false : true;

		spl_autoload_register(array($this, 'resolve'), true, $prepend);
	}
1138862
public function prepend($xpath, $prefix)
    {
        $expressions = array();

        // If the xpath prefix contains a union we need to wrap it in parentheses.
        if (preg_match(self::UNION_PATTERN, $prefix)) {
            $prefix = '('.$prefix.')';
        }

        // Split any unions into individual expressions.
        foreach ($this->splitUnionParts($xpath) as $expression) {
            $expression = trim($expression);
            $parenthesis = '';

            // If the union is inside some braces, we need to preserve the opening braces and apply
            // the prefix only inside it.
            if (preg_match('/^[\(\s*]+/', $expression, $matches)) {
                $parenthesis = $matches[0];
                $expression = substr($expression, strlen($parenthesis));
            }

            // add prefix before element selector
            if (0 === strpos($expression, '/')) {
                $expression = $prefix.$expression;
            } else {
                $expression = $prefix.'/'.$expression;
            }
            $expressions[] = $parenthesis.$expression;
        }

        return implode(' | ', $expressions);
    }
393414
public function registerPath($namespace, $path, $prepend = false)
    {
        $namespace = Normalizer::ns($namespace, true);
        $index     = substr($namespace, 0, 4);

        $this->indexes[$index] = true;

        $path = Normalizer::path($path, true);

        if (! isset($this->paths[$namespace])) {
            $this->paths[$namespace] = [];
        }
        if ($prepend) {
            array_unshift($this->paths[$namespace], $path);

            return $this;
        }
        array_push($this->paths[$namespace], $path);

        return $this;
    }
295919
public function register($prepend = false)
    {
        $this->composerClassLoader->unregister();
        spl_autoload_register(array($this, 'loadClassWithAlias'), true, $prepend);
    }
1356025
public function prependNamespace($namespace, $hints)
    {
        $hints = (array) $hints;

        if (isset($this->hints[$namespace])) {
            $hints = array_merge($hints, $this->hints[$namespace]);
        }

        $this->hints[$namespace] = $hints;
    }
946813
public function addMessages(array $messages, $prepend = false)
    {
        if ($prepend) {
            $messages = array_reverse($messages);
        }

        foreach ($messages as $message) {
            $this->addMessage($message, $prepend);
        }

        return $this;
    }
135573
public function register($throw = true, $prepend = false)
    {

        // register the class loader instance
        parent::register($prepend);

        // require the files registered with composer (e. g. Swift Mailer)
        foreach ($this->directories as $directory) {
            if (file_exists($directory . '/composer/autoload_files.php')) {
                $includeFiles = require $directory . '/composer/autoload_files.php';
                foreach ($includeFiles as $file) {
                    require_once $file;
                }
            }
        }
    }
1056127
public static final function prepend(array $Source, array $Prepend): array {
		return array_merge($Prepend, self::only($Source, array_filter(array_keys($Source), function($value) use ($Prepend){
			return is_int($value) || !array_key_exists($value, $Prepend); })));
	}
1090027
public function removePrefixPath($prefix, $path = null)
    {
        $prefix = $this->_formatPrefix($prefix);
        if ($this->_useStaticRegistry) {
            $registry =& self::$_staticPrefixToPaths[$this->_useStaticRegistry];
        } else {
            $registry =& $this->_prefixToPaths;
        }

        if (!isset($registry[$prefix])) {

            throw new Zend_Loader_PluginLoader_Exception('Prefix ' . $prefix . ' was not found in the PluginLoader.');
        }

        if ($path != null) {
            $pos = array_search($path, $registry[$prefix]);
            if (false === $pos) {

                throw new Zend_Loader_PluginLoader_Exception('Prefix ' . $prefix . ' / Path ' . $path . ' was not found in the PluginLoader.');
            }
            unset($registry[$prefix][$pos]);
        } else {
            unset($registry[$prefix]);
        }

        return $this;
    }
741870
public function add_template_directory($path, $namespace = null, $prepend = false) {
		$this->template->add_template_directory($path, $namespace, $prepend);
	}