File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
extension/BuildPhpExtension/private Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -17,14 +17,24 @@ Function Add-PhpDependencies {
17
17
Add-StepLog " Adding libraries (core)"
18
18
}
19
19
$phpBaseUrl = ' https://downloads.php.net/~windows/php-sdk/deps'
20
+ $phpTrunkBaseUrl = " https://downloads.php.net/~windows/php-sdk/deps/$ ( $Config.vs_version ) /$ ( $Config.arch ) "
20
21
$phpSeries = Invoke-WebRequest - Uri " $phpBaseUrl /series/packages-$ ( $Config.php_version ) -$ ( $Config.vs_version ) -$ ( $Config.arch ) -staging.txt" - UseBasicParsing
22
+ $phpTrunk = Invoke-WebRequest - Uri $phpTrunkBaseUrl - UseBasicParsing
21
23
foreach ($library in $Config.php_libraries ) {
22
24
try {
23
- $matches = $phpSeries.Content | Select-String - Pattern " (^|\n)$library .*"
24
- if ($matches.Count -eq 0 ) {
25
+ $matchesFound = $phpSeries.Content | Select-String - Pattern " (^|\n)$library .*"
26
+ if ($matchesFound.Count -eq 0 ) {
27
+ foreach ($file in $phpTrunk.Links.Href ) {
28
+ if ($file -match " ^$library " ) {
29
+ $matchesFound = $file | Select-String - Pattern ' .*'
30
+ break
31
+ }
32
+ }
33
+ }
34
+ if ($matchesFound.Count -eq 0 ) {
25
35
throw " Failed to find $library "
26
36
}
27
- $file = $matches .Matches [0 ].Value.Trim()
37
+ $file = $matchesFound .Matches [0 ].Value.Trim()
28
38
Invoke-WebRequest " $phpBaseUrl /$ ( $Config.vs_version ) /$ ( $Config.arch ) /$file " - OutFile $library
29
39
Expand-Archive $library " ../deps"
30
40
Add-BuildLog tick " $library " " Added $ ( $file -replace ' \.zip$' ) "
You can’t perform that action at this time.
0 commit comments