Fix switch-php-version command not working bug

This commit is contained in:
crazywhalecc 2025-12-04 21:21:27 +08:00
parent 64fde5fd8c
commit ee46c1c387
No known key found for this signature in database
GPG Key ID: 1F4BDD59391F2680

View File

@ -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("<info>Downloading PHP {$php_ver} source...</info>");
$this->input->setOption('with-php', $php_ver);
$downloaderOptions = DownloaderOptions::extractFromConsoleOptions($this->input->getOptions());
$downloader = new ArtifactDownloader($downloaderOptions);