application/manage/logic/RuntimeLogic.php
public static function fileDir($file, $base)
    {
        // 真实路径
        $file = realpath($file);
        $base = realpath($base);
        
        $file_str = '';
        while (1) {
            if ($file == $base) {
                $file_str = '/<a href="' . Url::build('index/runtime') . '">runtime</a>' . $file_str;
                break;
            }
            
            $file_parent = dirname($file);
            $file_current = iconv('gbk', 'utf-8', str_replace($file_parent, '', $file));
            if (is_dir($file)) {
                $file_path = self::processDirName($file, $base);
                $url = Url::build('index/runtime', [
                    'path' => base64_encode($file_path)
                ]);
                $file_str = '/<a href="' . $url . '">' . str_replace(DS, '', $file_current) . '</a>' . $file_str;
            } else {
                $file_str = $file_current . $file_str;
            }
            
            $file = $file_parent;
        }
        
        return str_replace('\\', '/', $file_str);
    }
public static function fileDir($file, $base)
    {
        // 真实路径
        $file = realpath($file);
        $base = realpath($base);
        
        $file_str = '';
        while (1) {
            if ($file == $base) {
                $file_str = '/<a href="' . Url::build('index/runtime') . '">runtime</a>' . $file_str;
                break;
            }
            
            $file_parent = dirname($file);
            $file_current = iconv('gbk', 'utf-8', str_replace($file_parent, '', $file));
            if (is_dir($file)) {
                $file_path = self::processDirName($file, $base);
                $url = Url::build('index/runtime', [
                    'path' => base64_encode($file_path)
                ]);
                $file_str = '/<a href="' . $url . '">' . str_replace(DS, '', $file_current) . '</a>' . $file_str;
            } else {
                $file_str = $file_current . $file_str;
            }
            
            $file = $file_parent;
        }
        
        return str_replace('\\', '/', $file_str);
    }
public static function fileDir ( $ file , $ base ) { // 真实路径 $ file = realpath ( $ file ) ; $ base = realpath ( $ base ) ; $ file_str = '' ; while ( 1 ) { if ( $ file == $ base ) { $ file_str = '/<a href="' . Url :: build ( 'index/runtime' ) . '">runtime</a>' . $ file_str ; break ; } $ file_parent = dirname ( $ file ) ; $ file_current = iconv ( 'gbk' , 'utf-8' , str_replace ( $ file_parent , '' , $ file ) ) ; if ( is_dir ( $ file ) ) { $ file_path = self :: processDirName ( $ file , $ base ) ; $ url = Url :: build ( 'index/runtime' , [ 'path' => base64_encode ( $ file_path ) ] ) ; $ file_str = '/<a href="' . $ url . '">' . str_replace ( DS , '' , $ file_current ) . '</a>' . $ file_str ; } else { $ file_str = $ file_current . $ file_str ; } $ file = $ file_parent ; } return str_replace ( '\\' , '/' , $ file_str ) ; }
文件目录

@param string $file
@return array
文件目录