Skip to content

Commit d69706a

Browse files
authored
Merge pull request #89 from mlocati/php8.1rc-take2
Detect RC<n>-dev snapshot versions
2 parents 2c51a8b + 0a5e447 commit d69706a

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

PhpManager/private/Constants.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ New-Variable -Option Constant -Scope Script -Name 'UNSTABLEPHP_RELEASECANDIDATE_
2525
# PHP non-stable identifiers regex
2626
New-Variable -Option Constant -Scope Script -Name 'UNSTABLEPHP_RX' -Value "$UNSTABLEPHP_ALPHA|$UNSTABLEPHP_BETA|$UNSTABLEPHP_RELEASECANDIDATE_LC|$UNSTABLEPHP_RELEASECANDIDATE_UC"
2727

28-
New-Variable -Option Constant -Scope Script -Name 'RX_ZIPARCHIVE' -Value "php-(?<version>\d+\.\d+\.\d+)(?:(?<unstabilityLevel>$UNSTABLEPHP_RX)(?<unstabilityVersion>[1-9]\d*)(?:-dev)?)?(?<threadSafe>-nts)?-Win32-(?:VC|vc|vs)(?<vcVersion>\d{1,2})-(?<architecture>x86|x64)\.zip"
28+
New-Variable -Option Constant -Scope Script -Name 'RX_ZIPARCHIVE' -Value "php-(?<version>\d+\.\d+\.\d+)(?:(?<unstabilityLevel>$UNSTABLEPHP_RX)(?<unstabilityVersion>[1-9]\d*))?(?<threadSafe>-nts)?-Win32-(?:VC|vc|vs)(?<vcVersion>\d{1,2})-(?<architecture>x86|x64)\.zip"
2929
New-Variable -Option Constant -Scope Script -Name 'RX_ZIPARCHIVE_SNAPSHOT' -Value "/(?:master|(?:php-(?<version>\d+\.\d+)))/r[0-9a-f]{7,}/php-(?:master|\d+\.\d+)-(?<threadSafe>nts|ts)-windows-(?:VC|vc|vs)(?<vcVersion>\d{1,2})-(?<architecture>x86|x64)-r[0-9a-f]{7,}\.zip$"
3030
New-Variable -Option Constant -Scope Script -Name 'RX_ZIPARCHIVE_SNAPSHOT_SHIVAMMATHUR' -Value "/php-(?:master|\d+\.\d+)-(?<threadSafe>nts|ts)-windows-(?:VC|vc|vs)(?<vcVersion>\d{1,2})-(?<architecture>x86|x64).zip$"
3131

PhpManager/private/PhpVersion.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,13 +307,13 @@ echo PHP_VERSION, chr(9), PHP_INT_SIZE * 8, chr(9), $matches[1];
307307
if ($LASTEXITCODE -ne 0 -or -Not($executableResult)) {
308308
throw "Failed to execute php.exe: $LASTEXITCODE"
309309
}
310-
$match = $executableResult | Select-String -Pattern "(?<version>\d+\.\d+\.\d+)(?<stabilityLevel>-dev|(?:$Script:UNSTABLEPHP_RX))?(?<stabilityVersion>\d+)?(-dev)?\t(?<bits>\d+)\t(?<apiVersion>\d+)$"
310+
$match = $executableResult | Select-String -Pattern "(?<version>\d+\.\d+\.\d+)(?<stabilityLevel>([Rr][Cc]\d+)?-dev|(?:$Script:UNSTABLEPHP_RX))?(?<stabilityVersion>\d+)?\t(?<bits>\d+)\t(?<apiVersion>\d+)$"
311311
if (-not($match)) {
312312
throw "Unsupported PHP version: $executableResult"
313313
}
314314
$groups = $match.Matches[0].Groups
315315
$data.Version = $groups['version'].Value
316-
if ($groups['stabilityLevel'].Value -eq '-dev') {
316+
if ($groups['stabilityLevel'].Value -match '-dev$') {
317317
$data.UnstabilityLevel = $Script:UNSTABLEPHP_SNAPSHOT
318318
} else {
319319
$data.UnstabilityLevel = $groups['stabilityLevel'].Value

PhpManager/public/Install-Php.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
$searchReleaseStates = @($Script:RELEASESTATE_SNAPSHOT)
9898
$rxSearchVersion = "^$($match.Matches[0].Groups[1].Value -replace '\.', '\.')-dev$"
9999
} else {
100-
$match = $Version | Select-String -Pattern "^([1-9]\d*)(?:\.(\d+))?(?:\.(\d+))?(?:($Script:UNSTABLEPHP_RX)(\d*)(?:-dev)?)?$"
100+
$match = $Version | Select-String -Pattern "^([1-9]\d*)(?:\.(\d+))?(?:\.(\d+))?(?:($Script:UNSTABLEPHP_RX)(\d*))?$"
101101
if ($null -eq $match) {
102102
throw "The specified PHP version ($Version) is malformed"
103103
}

0 commit comments

Comments
 (0)