From bfd34cc12ff9135a37e06ff484440d8c1786ca7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Tue, 15 Oct 2024 13:50:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=89=AB=E6=8F=8F=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/think-library/src/extend/ToolsExtend.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugin/think-library/src/extend/ToolsExtend.php b/plugin/think-library/src/extend/ToolsExtend.php index 2394934dc..b7da49f36 100644 --- a/plugin/think-library/src/extend/ToolsExtend.php +++ b/plugin/think-library/src/extend/ToolsExtend.php @@ -22,7 +22,6 @@ use Closure; use FilesystemIterator; use Generator; use SplFileInfo; -use think\File; /** * 通用工具扩展 @@ -134,7 +133,7 @@ class ToolsExtend if (file_exists($path)) { 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 ($depth === null || $depth > 0) { + if ($depth === null || $depth > 1) { yield from static::findFilesYield($item->getPathname(), $filterFile, $filterPath, $depth !== null ? $depth - 1 : null, $appendPath); } if ($appendPath) yield $item;