src/Autoloader.php
public function addPath($namespace, $path, $prepend = false, $psr0 = false)
    {
        if ($path != '') {
            $path = rtrim(str_replace('\\', '/', $path), '/') . '/';
        }
        
        if ($psr0) {
            $this->psr0 = true;
            if (! isset($this->psr0Paths[$namespace])) {
                $this->psr0Paths[$namespace] = array();
            }
            if ($prepend) {
                array_unshift($this->psr0Paths[$namespace], $path);
            } else {
                array_push($this->psr0Paths[$namespace], $path);
            }
        } else {
            $namespace = '\\' . trim($namespace, '\\');
            
            if (! isset($this->paths[$namespace])) {
                $this->paths[$namespace] = array();
            }
            if ($prepend) {
                array_unshift($this->paths[$namespace], $path);
            } else {
                array_push($this->paths[$namespace], $path);
            }
        }
    }
public function addPath($namespace, $path, $prepend = false, $psr0 = false)
    {
        if ($path != '') {
            $path = rtrim(str_replace('\\', '/', $path), '/') . '/';
        }
        
        if ($psr0) {
            $this->psr0 = true;
            if (! isset($this->psr0Paths[$namespace])) {
                $this->psr0Paths[$namespace] = array();
            }
            if ($prepend) {
                array_unshift($this->psr0Paths[$namespace], $path);
            } else {
                array_push($this->psr0Paths[$namespace], $path);
            }
        } else {
            $namespace = '\\' . trim($namespace, '\\');
            
            if (! isset($this->paths[$namespace])) {
                $this->paths[$namespace] = array();
            }
            if ($prepend) {
                array_unshift($this->paths[$namespace], $path);
            } else {
                array_push($this->paths[$namespace], $path);
            }
        }
    }
public function addPath ( $ namespace , $ path , $ prepend = false , $ psr0 = false ) { if ( $ path != '' ) { $ path = rtrim ( str_replace ( '\\' , '/' , $ path ) , '/' ) . '/' ; } if ( $ psr0 ) { $ this -> psr0 = true ; if ( ! isset ( $ this -> psr0Paths [ $ namespace ] ) ) { $ this -> psr0Paths [ $ namespace ] = array ( ) ; } if ( $ prepend ) { array_unshift ( $ this -> psr0Paths [ $ namespace ] , $ path ) ; } else { array_push ( $ this -> psr0Paths [ $ namespace ] , $ path ) ; } } else { $ namespace = '\\' . trim ( $ namespace , '\\' ) ; if ( ! isset ( $ this -> paths [ $ namespace ] ) ) { $ this -> paths [ $ namespace ] = array ( ) ; } if ( $ prepend ) { array_unshift ( $ this -> paths [ $ namespace ] , $ path ) ; } else { array_push ( $ this -> paths [ $ namespace ] , $ path ) ; } } }
Add an autload directory for a namespace.

@param string $namespace
Namespace prefix (i.e. with trailing backslash).
@param string $path
Directory path.
@param bool $prepend
If true, the path will be prepended instead of
appended.
@param bool $psr0
Whether to use PSR-0 instead of PSR-4 for this path.
Add an autload directory for a namespace .