|
|
@ -22,7 +22,7 @@ class DirScannerTest extends DirScanner { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
echo "\n"; |
|
|
|
echo "\n"; |
|
|
|
echo "==function secureLink==\n"; |
|
|
|
echo "==function secureLinkTest==\n"; |
|
|
|
echo "secret: " . $this->getNginxSecret() . "\n"; |
|
|
|
echo "secret: " . $this->getNginxSecret() . "\n"; |
|
|
|
echo "user ip: " . $this->getUserIp() . "\n"; |
|
|
|
echo "user ip: " . $this->getUserIp() . "\n"; |
|
|
|
echo "timeout: " . $this->getNginxSecureTimeout() . " seconds\n"; |
|
|
|
echo "timeout: " . $this->getNginxSecureTimeout() . " seconds\n"; |
|
|
@ -33,9 +33,29 @@ class DirScannerTest extends DirScanner { |
|
|
|
echo "\n"; |
|
|
|
echo "\n"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function getFilePathTest($directory, $filename, $extension) { |
|
|
|
|
|
|
|
echo "\n"; |
|
|
|
|
|
|
|
echo "==function getFilePathTest==\n"; |
|
|
|
|
|
|
|
echo "directory: {$directory}\n"; |
|
|
|
|
|
|
|
echo "filename: {$filename}\n"; |
|
|
|
|
|
|
|
echo "extension: {$extension}\n"; |
|
|
|
|
|
|
|
$url = $this->getFilePath($directory, $filename, $extension); |
|
|
|
|
|
|
|
echo "path: {$url}\n"; |
|
|
|
|
|
|
|
$this->setNginxSecure('on', 'Tester'); |
|
|
|
|
|
|
|
$secure_url = $this->getFilePath($directory, $filename, $extension); |
|
|
|
|
|
|
|
echo "secure path: {$secure_url}\n"; |
|
|
|
|
|
|
|
$this->setNginxSecure('off'); |
|
|
|
|
|
|
|
echo "\n"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//--调用测试方法-- |
|
|
|
//--调用测试方法-- |
|
|
|
$scanner = new DirScannerTest(); |
|
|
|
$scanner = new DirScannerTest(); |
|
|
|
$scanner->secureLinkTest('/default/', 'foo=bar', '127.0.0.1'); |
|
|
|
$scanner->secureLinkTest('/default/', 'foo=bar', '127.0.0.1'); |
|
|
|
|
|
|
|
$scanner->getFilePathTest('/content/小说/金庸/', '书剑恩仇录', 'md'); |
|
|
|
|
|
|
|
$scanner->getFilePathTest('/content/小说/金庸/', '封面图', 'jpg'); |
|
|
|
|
|
|
|
$scanner->getFilePathTest('/content/视频/游戏/', 'demo', 'm3u8'); |
|
|
|
|
|
|
|
$scanner->getFilePathTest('/content/视频/游戏/', '推荐', 'url'); |
|
|
|
|
|
|
|
$scanner->getFilePathTest('/content/视频/游戏/', '测试', 'mp4'); |
|
|
|