mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2026-06-08 04:48:10 +08:00
fix: 修改文件扫描调用
This commit is contained in:
parent
284c4639df
commit
bfd34cc12f
@ -22,7 +22,6 @@ use Closure;
|
|||||||
use FilesystemIterator;
|
use FilesystemIterator;
|
||||||
use Generator;
|
use Generator;
|
||||||
use SplFileInfo;
|
use SplFileInfo;
|
||||||
use think\File;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通用工具扩展
|
* 通用工具扩展
|
||||||
@ -134,7 +133,7 @@ class ToolsExtend
|
|||||||
if (file_exists($path)) {
|
if (file_exists($path)) {
|
||||||
foreach (is_file($path) ? [new SplFileInfo($path)] : new FilesystemIterator($path, FilesystemIterator::SKIP_DOTS) as $item) {
|
foreach (is_file($path) ? [new SplFileInfo($path)] : new FilesystemIterator($path, FilesystemIterator::SKIP_DOTS) as $item) {
|
||||||
if (($isDir = $item->isDir() && !$item->isLink()) && ($filterPath === null || $filterPath($item))) {
|
if (($isDir = $item->isDir() && !$item->isLink()) && ($filterPath === null || $filterPath($item))) {
|
||||||
if ($depth === null || $depth > 0) {
|
if ($depth === null || $depth > 1) {
|
||||||
yield from static::findFilesYield($item->getPathname(), $filterFile, $filterPath, $depth !== null ? $depth - 1 : null, $appendPath);
|
yield from static::findFilesYield($item->getPathname(), $filterFile, $filterPath, $depth !== null ? $depth - 1 : null, $appendPath);
|
||||||
}
|
}
|
||||||
if ($appendPath) yield $item;
|
if ($appendPath) yield $item;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user