From 328bdc19051d70c6f451886815725a110fec240a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Mon, 9 Sep 2024 21:08:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3=20findFilesYield=20?= =?UTF-8?q?=E4=B8=BA=20findFilesArray=20=E4=BD=BF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/think-library/src/extend/PhinxExtend.php | 2 +- plugin/think-library/src/support/middleware/MultAccess.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/think-library/src/extend/PhinxExtend.php b/plugin/think-library/src/extend/PhinxExtend.php index 344740f31..8f6f46f4f 100644 --- a/plugin/think-library/src/extend/PhinxExtend.php +++ b/plugin/think-library/src/extend/PhinxExtend.php @@ -292,7 +292,7 @@ CODE; private static function nextFile(string $class): string { [$filename, $versions, $startVersion] = [Str::snake($class), [], 20009999999999]; - ToolsExtend::findFilesYield(syspath('database/migrations'), function (SplFileInfo $info) use ($class, $filename, &$versions) { + ToolsExtend::findFilesArray(syspath('database/migrations'), function (SplFileInfo $info) use ($class, $filename, &$versions) { $bname = pathinfo($info->getBasename(), PATHINFO_FILENAME); $versions[] = $version = intval(substr($bname, 0, 14)); if ($filename === substr($bname, 15) && unlink($info->getRealPath())) { diff --git a/plugin/think-library/src/support/middleware/MultAccess.php b/plugin/think-library/src/support/middleware/MultAccess.php index 2dd6a355e..4ae50108f 100644 --- a/plugin/think-library/src/support/middleware/MultAccess.php +++ b/plugin/think-library/src/support/middleware/MultAccess.php @@ -169,7 +169,7 @@ class MultAccess // 加载应用函数文件 if (is_file($file = "{$appPath}common{$ext}")) include_once $file; // 加载应用配置文件 - ToolsExtend::findFilesYield($appPath . 'config', function (SplFileInfo $info) use ($ext) { + ToolsExtend::findFilesArray($appPath . 'config', function (SplFileInfo $info) use ($ext) { if (strtolower(".{$info->getExtension()}") === $ext) { $this->app->config->load($info->getPathname(), $info->getBasename($ext)); }