|
|
@ -145,6 +145,11 @@ Class DirScanner { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取Nginx防盗链密钥 |
|
|
|
|
|
|
|
public function getNginxSecret() { |
|
|
|
|
|
|
|
return $this->nginxSecret; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//设置Nginx防盗链密钥 |
|
|
|
//设置Nginx防盗链密钥 |
|
|
|
public function setUserIp($userIp) { |
|
|
|
public function setUserIp($userIp) { |
|
|
|
if (!empty($userIp) && is_string($userIp)) { |
|
|
|
if (!empty($userIp) && is_string($userIp)) { |
|
|
@ -152,6 +157,11 @@ Class DirScanner { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取Nginx防盗链密钥 |
|
|
|
|
|
|
|
public function getUserIp() { |
|
|
|
|
|
|
|
return $this->userIp; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//设置Nginx防盗链MD5加密方式 |
|
|
|
//设置Nginx防盗链MD5加密方式 |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Nginx防盗链MD5加密方式参考下面网址中的示例, |
|
|
|
* Nginx防盗链MD5加密方式参考下面网址中的示例, |
|
|
@ -169,6 +179,11 @@ Class DirScanner { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取Nginx防盗链MD5加密方式 |
|
|
|
|
|
|
|
public function getNginxSecureLinkMd5Pattern() { |
|
|
|
|
|
|
|
return $this->nginxSecureLinkMd5Pattern; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//设置Nginx防盗链超时时长,单位:秒 |
|
|
|
//设置Nginx防盗链超时时长,单位:秒 |
|
|
|
public function setNginxSecureTimeout($timeout) { |
|
|
|
public function setNginxSecureTimeout($timeout) { |
|
|
|
if ((int)$timeout > 0) { |
|
|
|
if ((int)$timeout > 0) { |
|
|
@ -176,6 +191,16 @@ Class DirScanner { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取Nginx防盗链超时时长,单位:秒 |
|
|
|
|
|
|
|
public function getNginxSecureTimeout() { |
|
|
|
|
|
|
|
return $this->nginxSecureTimeout; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取是否开启防盗链 |
|
|
|
|
|
|
|
public function isSecureOn() { |
|
|
|
|
|
|
|
return $this->nginxSecureOn; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//扫描目录获取目录和文件列表,支持指定目录扫描深度(目录级数) |
|
|
|
//扫描目录获取目录和文件列表,支持指定目录扫描深度(目录级数) |
|
|
|
public function scan($dir, $levels = 3) { |
|
|
|
public function scan($dir, $levels = 3) { |
|
|
|
} |
|
|
|
} |
|
|
|