public function autoload($pClassName)
    {
        if(strpos($pClassName, '_') !== false){
            
    		$tokens = explode("_", $pClassName);
    		$size = count($tokens);
    		$path = '';
    		for ( $i = 0 ; $i<$size-1 ; $i++){
    			$path .= $tokens[$i].'/';
    		}
    		
            // Search for class.X.php
    		$filePath = '/' . $path . 'class.'.$tokens[$size-1] . '.php';
    		if (file_exists($this->root .'generis'.DIRECTORY_SEPARATOR .$filePath)){
    			require_once $this->root .'generis'.DIRECTORY_SEPARATOR .$filePath;
    			return;
    		}
            
            // Search for interface.X.php
    		$filePathInterface = '/' . $path . 'interface.'.$tokens[$size-1] . '.php';
    		if (file_exists($this->root .'generis'.DIRECTORY_SEPARATOR .$filePathInterface)){
    			require_once $this->root .'generis'.DIRECTORY_SEPARATOR .$filePathInterface;
    			return;
    		}
            
            // Search for trait.X.php
            $filePathTrait = '/' . $path . 'trait.'.$tokens[$size-1] . '.php';
    		if (file_exists($this->root .'generis'.DIRECTORY_SEPARATOR .$filePathTrait)){
    			require_once $this->root .'generis'.DIRECTORY_SEPARATOR .$filePathTrait;
    			return;
    		}
    		
    		if (file_exists($this->root .$filePath)){
    			require_once $this->root .$filePath;
    			return;
    		} elseif (file_exists($this->root .$filePathInterface)){
    		        require_once $this->root .$filePathInterface;
    		        return;
    		}
    		
    		$legacyPrefix = false;
    		foreach ($this->legacyPrefixes as $key => $namespace) {
    		    if (substr($pClassName, 0, strlen($key)) == $key) {
    		        $newClass = $namespace.strtr(substr($pClassName, strlen($key)), '_', '\\');
    		        $this->wrapClass($pClassName, $newClass);
    		        return;
    		    }
    		}
    	}
    }
public function autoload($pClassName)
    {
        if(strpos($pClassName, '_') !== false){
            
    		$tokens = explode("_", $pClassName);
    		$size = count($tokens);
    		$path = '';
    		for ( $i = 0 ; $i<$size-1 ; $i++){
    			$path .= $tokens[$i].'/';
    		}
    		
            // Search for class.X.php
    		$filePath = '/' . $path . 'class.'.$tokens[$size-1] . '.php';
    		if (file_exists($this->root .'generis'.DIRECTORY_SEPARATOR .$filePath)){
    			require_once $this->root .'generis'.DIRECTORY_SEPARATOR .$filePath;
    			return;
    		}
            
            // Search for interface.X.php
    		$filePathInterface = '/' . $path . 'interface.'.$tokens[$size-1] . '.php';
    		if (file_exists($this->root .'generis'.DIRECTORY_SEPARATOR .$filePathInterface)){
    			require_once $this->root .'generis'.DIRECTORY_SEPARATOR .$filePathInterface;
    			return;
    		}
            
            // Search for trait.X.php
            $filePathTrait = '/' . $path . 'trait.'.$tokens[$size-1] . '.php';
    		if (file_exists($this->root .'generis'.DIRECTORY_SEPARATOR .$filePathTrait)){
    			require_once $this->root .'generis'.DIRECTORY_SEPARATOR .$filePathTrait;
    			return;
    		}
    		
    		if (file_exists($this->root .$filePath)){
    			require_once $this->root .$filePath;
    			return;
    		} elseif (file_exists($this->root .$filePathInterface)){
    		        require_once $this->root .$filePathInterface;
    		        return;
    		}
    		
    		$legacyPrefix = false;
    		foreach ($this->legacyPrefixes as $key => $namespace) {
    		    if (substr($pClassName, 0, strlen($key)) == $key) {
    		        $newClass = $namespace.strtr(substr($pClassName, strlen($key)), '_', '\\');
    		        $this->wrapClass($pClassName, $newClass);
    		        return;
    		    }
    		}
    	}
    }
public function autoload ( $ pClassName ) { if ( strpos ( $ pClassName , '_' ) !== false ) { $ tokens = explode ( "_" , $ pClassName ) ; $ size = count ( $ tokens ) ; $ path = '' ; for ( $ i = 0 ; $ i < $ size - 1 ; $ i ++ ) { $ path .= $ tokens [ $ i ] . '/' ; } // Search for class.X.php $ filePath = '/' . $ path . 'class.' . $ tokens [ $ size - 1 ] . '.php' ; if ( file_exists ( $ this -> root . 'generis' . DIRECTORY_SEPARATOR . $ filePath ) ) { require_once $ this -> root . 'generis' . DIRECTORY_SEPARATOR . $ filePath ; return ; } // Search for interface.X.php $ filePathInterface = '/' . $ path . 'interface.' . $ tokens [ $ size - 1 ] . '.php' ; if ( file_exists ( $ this -> root . 'generis' . DIRECTORY_SEPARATOR . $ filePathInterface ) ) { require_once $ this -> root . 'generis' . DIRECTORY_SEPARATOR . $ filePathInterface ; return ; } // Search for trait.X.php $ filePathTrait = '/' . $ path . 'trait.' . $ tokens [ $ size - 1 ] . '.php' ; if ( file_exists ( $ this -> root . 'generis' . DIRECTORY_SEPARATOR . $ filePathTrait ) ) { require_once $ this -> root . 'generis' . DIRECTORY_SEPARATOR . $ filePathTrait ; return ; } if ( file_exists ( $ this -> root . $ filePath ) ) { require_once $ this -> root . $ filePath ; return ; } elseif ( file_exists ( $ this -> root . $ filePathInterface ) ) { require_once $ this -> root . $ filePathInterface ; return ; } $ legacyPrefix = false ; foreach ( $ this -> legacyPrefixes as $ key => $ namespace ) { if ( substr ( $ pClassName , 0 , strlen ( $ key ) ) == $ key ) { $ newClass = $ namespace . strtr ( substr ( $ pClassName , strlen ( $ key ) ) , '_' , '\\' ) ; $ this -> wrapClass ( $ pClassName , $ newClass ) ; return ; } } } }
Attempt to autload classes in tao

@access public
@author Joel Bout <joel@taotesting.com>
@param  string pClassName
@return void
Attempt to autload classes in tao