From c56ba224762c49211d986f2ced84ef0c3e773fd0 Mon Sep 17 00:00:00 2001 From: sunxyw Date: Sat, 11 Feb 2023 18:36:38 +0800 Subject: [PATCH 1/2] fix init command compatibility --- src/ZM/Command/InitCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ZM/Command/InitCommand.php b/src/ZM/Command/InitCommand.php index 5a1d73d7..23fa7585 100644 --- a/src/ZM/Command/InitCommand.php +++ b/src/ZM/Command/InitCommand.php @@ -125,7 +125,7 @@ class InitCommand extends Command $files = []; foreach ($patterns as $pattern) { // TODO: 优化代码,避免在循环中使用 array_merge 以减少资源消耗 - $files = array_merge($files, glob($this->getVendorPath($pattern), GLOB_BRACE)); + $files = array_merge($files, glob($this->getVendorPath($pattern))); } return array_map(fn ($file) => str_replace($this->getVendorPath(''), '', $file), $files); } From 50cc73c13252591f08476461a92b90bde52621cf Mon Sep 17 00:00:00 2001 From: sunxyw Date: Sat, 11 Feb 2023 18:42:32 +0800 Subject: [PATCH 2/2] fix init command duplicated autoload --- src/ZM/Command/InitCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ZM/Command/InitCommand.php b/src/ZM/Command/InitCommand.php index 23fa7585..54259d1d 100644 --- a/src/ZM/Command/InitCommand.php +++ b/src/ZM/Command/InitCommand.php @@ -62,7 +62,7 @@ class InitCommand extends Command if (!isset($composer['autoload'])) { $composer['autoload'] = $autoload; } else { - $composer['autoload'] = array_merge_recursive($composer['autoload'], $autoload); + $composer['autoload'] = array_merge($composer['autoload'], $autoload); } try {