Fix built-in php and composer install plugin error

This commit is contained in:
crazywhalecc 2025-03-10 11:17:27 +08:00 committed by Jerry Ma
parent f16dadf29e
commit 4c37294275

View File

@ -32,7 +32,11 @@ final class ConsoleApplication extends Application
// 初始化 Composer 变量
if (file_exists(WORKING_DIR . '/runtime/composer.phar')) {
echo '* Using native composer' . PHP_EOL;
putenv('COMPOSER_EXECUTABLE=' . WORKING_DIR . '/runtime/composer.phar');
if (WORKING_DIR . '/runtime/php' === PHP_BINARY) {
putenv('COMPOSER_EXECUTABLE="' . WORKING_DIR . '/runtime/php ' . WORKING_DIR . '/runtime/composer.phar"');
} else {
putenv('COMPOSER_EXECUTABLE="' . WORKING_DIR . '/runtime/composer.phar"');
}
}
$this->registerCommandLoader();