|
|
@ -165,7 +165,7 @@ Class DirScanner { |
|
|
|
'ctime' => $fstat['ctime'], |
|
|
|
'ctime' => $fstat['ctime'], |
|
|
|
], |
|
|
|
], |
|
|
|
'realpath' => $realpath, |
|
|
|
'realpath' => $realpath, |
|
|
|
'path' => $this->getFilePath( $id, $this->getDirectoryName($pathinfo['dirname'], $dirLevel), $pathinfo['filename'], $extension ), |
|
|
|
'path' => $this->getFilePath( $id, $this->getDirectoryName($pathinfo['dirname'], $dirLevel), $pathinfo['filename'], $extension, $fstat['mtime'] ), |
|
|
|
]; |
|
|
|
]; |
|
|
|
|
|
|
|
|
|
|
|
if ($extension == 'url') { |
|
|
|
if ($extension == 'url') { |
|
|
@ -264,7 +264,8 @@ Class DirScanner { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//根据文件生成相对路径 |
|
|
|
//根据文件生成相对路径 |
|
|
|
protected function getFilePath($id, $directory, $filename, $extension) { |
|
|
|
//@ver: 增加静态文件的更新时间戳作为文件版本参数 |
|
|
|
|
|
|
|
protected function getFilePath($id, $directory, $filename, $extension, $mtime) { |
|
|
|
if (empty($directory)) { |
|
|
|
if (empty($directory)) { |
|
|
|
$directory = '/'; |
|
|
|
$directory = '/'; |
|
|
|
} |
|
|
|
} |
|
|
@ -301,6 +302,11 @@ Class DirScanner { |
|
|
|
$path = $this->getSecureLink($path); |
|
|
|
$path = $this->getSecureLink($path); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//增加版本号ver参数 |
|
|
|
|
|
|
|
if (!in_array($extension, ['md', 'url', 'txt'])) { |
|
|
|
|
|
|
|
$path .= strpos($path, '?') !== false ? "&ver={$mtime}" : "?ver={$mtime}"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return $path; |
|
|
|
return $path; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|