Skip to content

Commit 721af42

Browse files
committed
Fix installing correct php dependency versions
1 parent 3dcd752 commit 721af42

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

extension/BuildPhpExtension/private/Add-PhpDependencies.ps1

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,12 @@ Function Add-PhpDependencies {
1717
Add-StepLog "Adding libraries (core)"
1818
}
1919
$phpBaseUrl = 'https://downloads.php.net/~windows/php-sdk/deps'
20-
$phpSeries = Invoke-WebRequest -Uri "$phpBaseUrl/$($Config.vs_version)/$($Config.arch)"
20+
$phpSeries = Invoke-WebRequest -Uri "$phpBaseUrl/series/packages-$($Config.php_version)-$($Config.vs_version)-$($Config.arch)-staging.txt" -UseBasicParsing
2121
foreach ($library in $Config.php_libraries) {
2222
try {
23-
$installed = $null
24-
foreach ($file in $phpSeries.Links.Href) {
25-
if ($file -match "^$library") {
26-
Invoke-WebRequest "$phpBaseUrl/$($Config.vs_version)/$($Config.arch)/$file" -OutFile $library
27-
Expand-Archive $library "../deps"
28-
$installed = $file
29-
break
30-
}
31-
}
32-
if (-not $installed) {
33-
throw "Failed to download $library"
23+
$matches = $phpSeries.Content | Select-String -Pattern "(^|\n)$library.*"
24+
if ($matches.Count -eq 0) {
25+
throw "Failed to find $library"
3426
}
3527
$file = $matches.Matches[0].Value.Trim()
3628
Invoke-WebRequest "$phpBaseUrl/$($Config.vs_version)/$($Config.arch)/$file" -OutFile $library

0 commit comments

Comments
 (0)