common/FrameAutoLoader.php [20:68]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
class FrameAutoLoader
{
    /**
     * 命名空间的路径
     */
    private static $nsPath = Array();

    /**
     * 自动载入类
     * @param $class
     */
    public static function autoload($class)
    {    	
    	$frameRootPathDepth = count(explode('\\', __NAMESPACE__));
        $root = explode('\\', trim($class, '\\'));
        $pathDepth = count($root);
        if($pathDepth > $frameRootPathDepth)
        {
        	$key = $className = $class;
	        if($pathDepth > $frameRootPathDepth + 1)
	        {
	        	$root = explode('\\', trim($class, '\\'), $frameRootPathDepth + 2);
	        	$className = $root[$frameRootPathDepth + 1];
	        	unset($root[$frameRootPathDepth + 1]);
	        	$key = implode($root, '\\');
	        }
	        else if($pathDepth == $frameRootPathDepth + 1)
	        {
	        	$root = explode('\\', trim($class, '\\'), $frameRootPathDepth + 1);
	        	$className = $root[$frameRootPathDepth];
	        	unset($root[$frameRootPathDepth]);
	        	$key = implode($root, '\\');
	        }
	        
        	if(isset(self::$nsPath[$key]))
	        {
	        	include_once self::$nsPath[$key] . DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $className) . '.php';
	        }
        }
    }

    /**
     * 设置根命名空间
     * @param $root
     * @param $path
     */
    public static function setRootNS($root, $path)
    {
        self::$nsPath[$root] = $path;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



consumer/FrameAutoLoader.php [20:68]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
class FrameAutoLoader
{
    /**
     * 命名空间的路径
     */
    private static $nsPath = Array();

    /**
     * 自动载入类
     * @param $class
     */
    public static function autoload($class)
    {
    	$frameRootPathDepth = count(explode('\\', __NAMESPACE__));
        $root = explode('\\', trim($class, '\\'));
        $pathDepth = count($root);
        if($pathDepth > $frameRootPathDepth)
        {
        	$key = $className = $class;
	        if($pathDepth > $frameRootPathDepth + 1)
	        {
	        	$root = explode('\\', trim($class, '\\'), $frameRootPathDepth + 2);
	        	$className = $root[$frameRootPathDepth + 1];
	        	unset($root[$frameRootPathDepth + 1]);
	        	$key = implode($root, '\\');
	        }
	        else if($pathDepth == $frameRootPathDepth + 1)
	        {
	        	$root = explode('\\', trim($class, '\\'), $frameRootPathDepth + 1);
	        	$className = $root[$frameRootPathDepth];
	        	unset($root[$frameRootPathDepth]);
	        	$key = implode($root, '\\');
	        }
	        
        	if(isset(self::$nsPath[$key]))
	        {
	        	include_once self::$nsPath[$key] . DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $className) . '.php';
	        }
        }
    }

    /**
     * 设置根命名空间
     * @param $root
     * @param $path
     */
    public static function setRootNS($root, $path)
    {
        self::$nsPath[$root] = $path;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



