Skip to content

Commit 4c37294

Browse files
committed
Fix built-in php and composer install plugin error
1 parent f16dadf commit 4c37294

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/ZM/ConsoleApplication.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@ public function __construct(string $name = 'zhamao-framework')
3232
// 初始化 Composer 变量
3333
if (file_exists(WORKING_DIR . '/runtime/composer.phar')) {
3434
echo '* Using native composer' . PHP_EOL;
35-
putenv('COMPOSER_EXECUTABLE=' . WORKING_DIR . '/runtime/composer.phar');
35+
if (WORKING_DIR . '/runtime/php' === PHP_BINARY) {
36+
putenv('COMPOSER_EXECUTABLE="' . WORKING_DIR . '/runtime/php ' . WORKING_DIR . '/runtime/composer.phar"');
37+
} else {
38+
putenv('COMPOSER_EXECUTABLE="' . WORKING_DIR . '/runtime/composer.phar"');
39+
}
3640
}
3741

3842
$this->registerCommandLoader();

0 commit comments

Comments
 (0)