From ee46c1c387fd63b65a538b25a91468984e902ff6 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Thu, 4 Dec 2025 21:21:27 +0800 Subject: [PATCH] Fix switch-php-version command not working bug --- src/Package/Command/SwitchPhpVersionCommand.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Package/Command/SwitchPhpVersionCommand.php b/src/Package/Command/SwitchPhpVersionCommand.php index 0e40c43e..38649dd7 100644 --- a/src/Package/Command/SwitchPhpVersionCommand.php +++ b/src/Package/Command/SwitchPhpVersionCommand.php @@ -67,13 +67,11 @@ class SwitchPhpVersionCommand extends BaseCommand InteractiveTerm::finish('Removed: ' . $source_dir); } - // Set the PHP version for download - // This defines the version that will be used when resolving php-src artifact - define('SPC_BUILD_PHP_VERSION', $php_ver); - // Download new PHP source $this->output->writeln("Downloading PHP {$php_ver} source..."); + $this->input->setOption('with-php', $php_ver); + $downloaderOptions = DownloaderOptions::extractFromConsoleOptions($this->input->getOptions()); $downloader = new ArtifactDownloader($downloaderOptions);