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 {
1717 Add-StepLog " Adding libraries (core)"
1818 }
1919 $phpBaseUrl = ' https://downloads.php.net/~windows/php-sdk/deps'
20+ $phpTrunkBaseUrl = " https://downloads.php.net/~windows/php-sdk/deps/$ ( $Config.vs_version ) /$ ( $Config.arch ) "
2021 $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
2123 foreach ($library in $Config.php_libraries ) {
2224 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 ) {
2535 throw " Failed to find $library "
2636 }
27- $file = $matches .Matches [0 ].Value.Trim()
37+ $file = $matchesFound .Matches [0 ].Value.Trim()
2838 Invoke-WebRequest " $phpBaseUrl /$ ( $Config.vs_version ) /$ ( $Config.arch ) /$file " - OutFile $library
2939 Expand-Archive $library " ../deps"
3040 Add-BuildLog tick " $library " " Added $ ( $file -replace ' \.zip$' ) "
You can’t perform that action at this time.
0 commit comments