File tree Expand file tree Collapse file tree 1 file changed +4
-12
lines changed
extension/BuildPhpExtension/private Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -17,20 +17,12 @@ Function Add-PhpDependencies {
17
17
Add-StepLog " Adding libraries (core)"
18
18
}
19
19
$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
21
21
foreach ($library in $Config.php_libraries ) {
22
22
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 "
34
26
}
35
27
$file = $matches.Matches [0 ].Value.Trim()
36
28
Invoke-WebRequest " $phpBaseUrl /$ ( $Config.vs_version ) /$ ( $Config.arch ) /$file " - OutFile $library
You can’t perform that action at this time.
0 commit comments