gear/Core/Autoloader.php
/**
     * Add a base directory for a namespace.
     *
     * @param mixed $prefixes An array contains namespace with corresponding base directory, or string with namespace.
     * @param mixed $baseDir If $prefixes is an array $baseDir is ignored, else is a string containing base directory.
     *
     * @return \Gear\Core\Autoloader Pointer for chaining call.
     */
Add a base directory for a namespace.
@param mixed $prefixes An array contains namespace with corresponding base directory, or string with namespace.
@param mixed $baseDir If $prefixes is an array $baseDir is ignored, else is a string containing base directory.

@return \Gear\Core\Autoloader Pointer for chaining call.
Add a base directory for a namespace . @param mixed $prefixes An array contains namespace with corresponding base directory or string with namespace . @param mixed $baseDir If $prefixes is an array $baseDir is ignored else is a string containing base directory . @return \ Gear \ Core \ Autoloader Pointer for chaining call .
public function addNamespace($prefixes, $baseDir = null)
    {
        if (is_array($prefixes)) {
            foreach ($prefixes as $prefix => $dir) {
                $this->addNamespace($prefix, $dir);
            }
        } else {
            $prefix = trim($prefixes, '\\') . '\\';
            if (!isset($this->prefixes[$prefix])) {
                $this->prefixes[$prefix] = [];
            }
            if (is_array($baseDir)) {
                foreach ($baseDir as $dir) {
                    $this->addNamespace($prefix, $dir);
                }
            } else {
                $baseDir = rtrim($baseDir, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
                $this->prefixes[$prefix][] = $baseDir;
            }
        }
        return $this;
    }
public function addNamespace ( $ prefixes , $ baseDir = null ) { if ( is_array ( $ prefixes ) ) { foreach ( $ prefixes as $ prefix => $ dir ) { $ this -> addNamespace ( $ prefix , $ dir ) ; } } else { $ prefix = trim ( $ prefixes , '\\' ) . '\\' ; if ( ! isset ( $ this -> prefixes [ $ prefix ] ) ) { $ this -> prefixes [ $ prefix ] = [ ] ; } if ( is_array ( $ baseDir ) ) { foreach ( $ baseDir as $ dir ) { $ this -> addNamespace ( $ prefix , $ dir ) ; } } else { $ baseDir = rtrim ( $ baseDir , DIRECTORY_SEPARATOR ) . DIRECTORY_SEPARATOR ; $ this -> prefixes [ $ prefix ] [ ] = $ baseDir ; } } return $ this ; }
Add a base directory for a namespace.
Add a base directory for a namespace .