mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-19 13:24:51 +08:00
Add switch-php-version specific patch version support
This commit is contained in:
parent
3ce302d0e6
commit
b354e017ba
@ -32,8 +32,12 @@ class SwitchPhpVersionCommand extends BaseCommand
|
|||||||
{
|
{
|
||||||
$php_ver = $this->input->getArgument('php-major-version');
|
$php_ver = $this->input->getArgument('php-major-version');
|
||||||
if (!in_array($php_ver, ['7.4', '8.0', '8.1', '8.2', '8.3'])) {
|
if (!in_array($php_ver, ['7.4', '8.0', '8.1', '8.2', '8.3'])) {
|
||||||
$this->output->writeln('<error>Invalid PHP major version ' . $php_ver . ' !</error>');
|
// match x.y.z
|
||||||
return static::FAILURE;
|
preg_match('/^\d+\.\d+\.\d+$/', $php_ver, $matches);
|
||||||
|
if (!$matches) {
|
||||||
|
$this->output->writeln('<error>Invalid PHP version ' . $php_ver . ' !</error>');
|
||||||
|
return static::FAILURE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// detect if downloads/.lock.json exists
|
// detect if downloads/.lock.json exists
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user