mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-24 17:15:36 +08:00
Merge pull request #295 from zhamao-robot/fix-init-command-compatibility
修复初始化命令兼容性问题
This commit is contained in:
@@ -62,7 +62,7 @@ class InitCommand extends Command
|
|||||||
if (!isset($composer['autoload'])) {
|
if (!isset($composer['autoload'])) {
|
||||||
$composer['autoload'] = $autoload;
|
$composer['autoload'] = $autoload;
|
||||||
} else {
|
} else {
|
||||||
$composer['autoload'] = array_merge_recursive($composer['autoload'], $autoload);
|
$composer['autoload'] = array_merge($composer['autoload'], $autoload);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -125,7 +125,7 @@ class InitCommand extends Command
|
|||||||
$files = [];
|
$files = [];
|
||||||
foreach ($patterns as $pattern) {
|
foreach ($patterns as $pattern) {
|
||||||
// TODO: 优化代码,避免在循环中使用 array_merge 以减少资源消耗
|
// 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);
|
return array_map(fn ($file) => str_replace($this->getVendorPath(''), '', $file), $files);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user