fix plugin:make autoload bug

This commit is contained in:
crazywhalecc 2023-05-20 19:01:55 +08:00 committed by Jerry Ma
parent 6cc45aed43
commit 7f0761e545
2 changed files with 3 additions and 2 deletions

View File

@ -50,7 +50,7 @@ class Framework
public const VERSION_ID = 715;
/** @var string 版本名称 */
public const VERSION = '3.1.9';
public const VERSION = '3.1.10';
/**
* @var RuntimePreferences 运行时偏好(环境信息&参数)

View File

@ -83,7 +83,8 @@ class PluginGenerator
// TODO: 寻找 PHP 运行环境和 Composer 是否在当前目录的情况
chdir($plugin_base_dir);
$env = ZMUtil::getComposerExecutable();
passthru(PHP_BINARY . ' ' . escapeshellcmd($env) . ' dump-autoload');
$cmd = $env === 'composer' ? $env . ' dump-autoload' : PHP_BINARY . ' ' . escapeshellcmd($env) . ' dump-autoload';
passthru($cmd);
chdir(WORKING_DIR);
return $plugin_base_dir;
}