mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 12:54:52 +08:00
Add patch version support for downloading php-src
This commit is contained in:
parent
73654e5984
commit
4e08295cea
@ -123,10 +123,15 @@ class DownloadCommand extends BaseCommand
|
|||||||
// Define PHP major version
|
// Define PHP major version
|
||||||
$ver = $this->php_major_ver = $this->getOption('with-php') ?? '8.1';
|
$ver = $this->php_major_ver = $this->getOption('with-php') ?? '8.1';
|
||||||
define('SPC_BUILD_PHP_VERSION', $ver);
|
define('SPC_BUILD_PHP_VERSION', $ver);
|
||||||
|
// match x.y
|
||||||
preg_match('/^\d+\.\d+$/', $ver, $matches);
|
preg_match('/^\d+\.\d+$/', $ver, $matches);
|
||||||
if (!$matches) {
|
if (!$matches) {
|
||||||
logger()->error("bad version arg: {$ver}, x.y required!");
|
// match x.y.z
|
||||||
return static::FAILURE;
|
preg_match('/^\d+\.\d+\.\d+$/', $ver, $matches);
|
||||||
|
if (!$matches) {
|
||||||
|
logger()->error("bad version arg: {$ver}, x.y or x.y.z required!");
|
||||||
|
return static::FAILURE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// retry
|
// retry
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user