From dc46a52080d14e3803ba584988c4bed243a01db0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Wed, 16 Oct 2024 20:46:31 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E8=84=9A=E6=9C=AC=E8=B7=AF=E5=BE=84=E8=AE=A1=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/think-library/src/extend/ToolsExtend.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugin/think-library/src/extend/ToolsExtend.php b/plugin/think-library/src/extend/ToolsExtend.php index 31ab98187..d199a51a2 100644 --- a/plugin/think-library/src/extend/ToolsExtend.php +++ b/plugin/think-library/src/extend/ToolsExtend.php @@ -72,7 +72,7 @@ class ToolsExtend public static function removeEmptyDirectory(string $path): bool { foreach (self::findFilesYield($path, null, null, true) as $item) { - ($item->isFile() || $item->isLink()) ? unlink($item->getRealPath()) : rmdir($item->getRealPath()); + ($item->isFile() || $item->isLink()) ? unlink($item->getPathname()) : rmdir($item->getPathname()); } return is_file($path) ? unlink($path) : (!is_dir($path) || rmdir($path)); } @@ -107,8 +107,8 @@ class ToolsExtend if ($info->isFile() && ($filter === null || $filter($info) !== false)) { $files[] = $short ? $info->getBasename() : $info->getPathname(); } - if ($info->isDir()) foreach (static::findFilesYield($info->getRealPath(), $depth, $filter) as $file) { - $files[] = $short ? substr($file->getRealPath(), strlen($info->getRealPath()) + 1) : $file->getRealPath(); + if ($info->isDir()) foreach (static::findFilesYield($info->getPathname(), $depth, $filter) as $file) { + $files[] = $short ? substr($file->getPathname(), strlen($info->getPathname()) + 1) : $file->getPathname(); } } return $files;