|
|
|
@ -35,10 +35,6 @@ Class DirScanner {
@@ -35,10 +35,6 @@ Class DirScanner {
|
|
|
|
|
private $scanResults = array(); //目录扫描结果 |
|
|
|
|
private $tree = array(); //目录扫描树形结构 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private $maxFileNumber = 1000; //目录下最大文件数量支持 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected $supportFileExtensions = array( //支持的文件类型 |
|
|
|
|
'txt', //纯文本 |
|
|
|
|
'md', //纯文本 |
|
|
|
@ -562,7 +558,6 @@ Class DirScanner {
@@ -562,7 +558,6 @@ Class DirScanner {
|
|
|
|
|
$nextLevels = $levels - $this->scanningDirLevel; |
|
|
|
|
|
|
|
|
|
$files = scandir($dir); |
|
|
|
|
$counter = 0; |
|
|
|
|
foreach($files as $file) { |
|
|
|
|
if (in_array($file, $ignore_files) || !$this->isValid($file)) {continue;} |
|
|
|
|
|
|
|
|
@ -587,8 +582,6 @@ Class DirScanner {
@@ -587,8 +582,6 @@ Class DirScanner {
|
|
|
|
|
$branch = array_merge(['pid' => $pid], $branch); |
|
|
|
|
} |
|
|
|
|
}else { |
|
|
|
|
if ($counter >= $this->maxFileNumber) {break;} //最大文件数量限制 |
|
|
|
|
|
|
|
|
|
$pathinfo = pathinfo($realpath); |
|
|
|
|
$extension = strtolower($pathinfo['extension']); |
|
|
|
|
if ( in_array($extension, $this->supportFileExtensions) ) { |
|
|
|
@ -611,8 +604,6 @@ Class DirScanner {
@@ -611,8 +604,6 @@ Class DirScanner {
|
|
|
|
|
$this->scanResults[$branch['id']] = $branch; |
|
|
|
|
$tree[$branch['id']] = $branch; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$counter ++; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|