mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2026-06-08 21:08:09 +08:00
fix: 修正 findFilesYield 为 findFilesArray 使用
This commit is contained in:
parent
1f19867993
commit
328bdc1905
@ -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())) {
|
||||||
|
|||||||
@ -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));
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user