fix: 修正 findFilesYield 为 findFilesArray 使用

This commit is contained in:
邹景立 2024-09-09 21:08:23 +08:00
parent 1f19867993
commit 328bdc1905
2 changed files with 2 additions and 2 deletions

View File

@ -292,7 +292,7 @@ CODE;
private static function nextFile(string $class): string private static function nextFile(string $class): string
{ {
[$filename, $versions, $startVersion] = [Str::snake($class), [], 20009999999999]; [$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); $bname = pathinfo($info->getBasename(), PATHINFO_FILENAME);
$versions[] = $version = intval(substr($bname, 0, 14)); $versions[] = $version = intval(substr($bname, 0, 14));
if ($filename === substr($bname, 15) && unlink($info->getRealPath())) { if ($filename === substr($bname, 15) && unlink($info->getRealPath())) {

View File

@ -169,7 +169,7 @@ class MultAccess
// 加载应用函数文件 // 加载应用函数文件
if (is_file($file = "{$appPath}common{$ext}")) include_once $file; 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) { if (strtolower(".{$info->getExtension()}") === $ext) {
$this->app->config->load($info->getPathname(), $info->getBasename($ext)); $this->app->config->load($info->getPathname(), $info->getBasename($ext));
} }