|
|
|
@ -69,11 +69,11 @@ Class DirScanner {
@@ -69,11 +69,11 @@ Class DirScanner {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//解析描述文件内容 |
|
|
|
|
private function parseDescriptionFiles() { |
|
|
|
|
private function parseDescriptionFiles($realpath) { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//解析快捷方式文件内容 |
|
|
|
|
private function parseShortCuts() { |
|
|
|
|
private function parseShortCuts($realpath) { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//根据文件路径生成唯一编号 |
|
|
|
@ -107,7 +107,34 @@ Class DirScanner {
@@ -107,7 +107,34 @@ Class DirScanner {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//根据文件生成相对路径 |
|
|
|
|
protected function getFilePath() { |
|
|
|
|
protected function getFilePath($directory, $filename, $extension) { |
|
|
|
|
$extensionPathMap = [ //默认每种文件读取内容最大大小 |
|
|
|
|
'txt' => '', |
|
|
|
|
'md' => '/view/', |
|
|
|
|
'url' => '/link/', |
|
|
|
|
'm3u8' => '/m3u8/', |
|
|
|
|
'jpg' => "{$directory}{$filename}.{$extension}", |
|
|
|
|
'png' => "{$directory}{$filename}.{$extension}", |
|
|
|
|
'gif' => "{$directory}{$filename}.{$extension}", |
|
|
|
|
'ico' => "{$directory}{$filename}.{$extension}", |
|
|
|
|
'mp4' => "{$directory}{$filename}.{$extension}", |
|
|
|
|
'ts' => "{$directory}{$filename}.{$extension}", |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
$path = isset($extensionPathMap[$extension]) ? $extensionPathMap[$extension] : ''; |
|
|
|
|
|
|
|
|
|
if (!empty($path) && in_array($extension, ['md', 'url', 'm3u8'])) { |
|
|
|
|
if ($this->nginxSecureOn && $extension == 'm3u8') { |
|
|
|
|
$path = $this->getSecureLink($path); |
|
|
|
|
$path = "{$path}&file=" . urlencode($filename); |
|
|
|
|
}else { |
|
|
|
|
$path = "{$path}?file=" . urlencode($filename); |
|
|
|
|
} |
|
|
|
|
}else if (!empty($path) && $this->nginxSecureOn) { |
|
|
|
|
$path = $this->getSecureLink($path); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return $path; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -116,6 +143,8 @@ Class DirScanner {
@@ -116,6 +143,8 @@ Class DirScanner {
|
|
|
|
|
$status = false; |
|
|
|
|
if (is_string($secureOn) && strtolower($secureOn) == 'on') { |
|
|
|
|
$status = true; |
|
|
|
|
}else if (is_string($secureOn) && strtolower($secureOn) == 'off') { |
|
|
|
|
$status = false; |
|
|
|
|
}else if ((bool)$secureOn == true) { |
|
|
|
|
$status = true; |
|
|
|
|
} |
|
|
|
|