Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions determine-revision.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ param (
$ErrorActionPreference = "Stop"

# Ensure TLS 1.2/1.3 on older .NET / Windows PowerShell
[Net.ServicePointManager]::SecurityProtocol = `
[Net.SecurityProtocolType]::Tls12 -bor `
[Net.SecurityProtocolType]::Tls13
$securityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
if ([Enum]::GetNames([Net.SecurityProtocolType]) -contains "Tls13") {
$securityProtocol = $securityProtocol -bor [Net.SecurityProtocolType]::Tls13
}
[Net.ServicePointManager]::SecurityProtocol = $securityProtocol

function Get-ReleasesJson([string] $url) {
return Invoke-RestMethod -Uri $url -UseBasicParsing
Expand Down
17 changes: 12 additions & 5 deletions run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ param (

$ErrorActionPreference = "Stop"

# Ensure TLS 1.2/1.3 on older .NET / Windows PowerShell
$securityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
if ([Enum]::GetNames([Net.SecurityProtocolType]) -contains "Tls13") {
$securityProtocol = $securityProtocol -bor [Net.SecurityProtocolType]::Tls13
}
[Net.ServicePointManager]::SecurityProtocol = $securityProtocol

$versions = @{
"7.0" = "vc14"
"7.1" = "vc14"
Expand Down Expand Up @@ -53,7 +60,7 @@ if (-not (Test-Path "php-sdk")) {

$temp = New-TemporaryFile | Rename-Item -NewName {$_.Name + ".zip"} -PassThru
$url = "https://github.com/php/php-sdk-binary-tools/releases/download/php-sdk-2.3.0/php-sdk-binary-tools-php-sdk-2.3.0.zip"
Invoke-WebRequest $url -OutFile $temp
Invoke-WebRequest $url -OutFile $temp -UseBasicParsing
Expand-Archive $temp -DestinationPath "."
Rename-Item "php-sdk-binary-tools-php-sdk-2.3.0" "php-sdk"
}
Expand All @@ -67,7 +74,7 @@ if (-not (Test-path "php-bin")) {
$fname = "php-$revision-$tspart-$vs-$arch.zip"
$url = "$baseurl/$fname"
Write-Output "Downloading $url ..."
Invoke-WebRequest $url -OutFile $temp
Invoke-WebRequest $url -OutFile $temp -UseBasicParsing
Expand-Archive $temp "php-bin"
}

Expand All @@ -78,14 +85,14 @@ if (-not (Test-Path "php-dev")) {
$fname = "php-devel-pack-$revision-$tspart-$vs-$arch.zip"
$url = "$baseurl/$fname"
Write-Output "Downloading $url ..."
Invoke-WebRequest $url -OutFile $temp
Invoke-WebRequest $url -OutFile $temp -UseBasicParsing
Expand-Archive $temp "."
Rename-Item "php-$revision-devel-$vs-$arch" "php-dev"
}

if ($deps.Count -gt 0) {
$baseurl = "https://downloads.php.net/~windows/php-sdk/deps"
$series = Invoke-WebRequest "$baseurl/series/packages-$version-$vs-$arch-staging.txt"
$series = Invoke-WebRequest "$baseurl/series/packages-$version-$vs-$arch-staging.txt" -UseBasicParsing
$remainder = @()
$installed = $false
foreach ($dep in $deps) {
Expand All @@ -95,7 +102,7 @@ if ($deps.Count -gt 0) {
$temp = New-TemporaryFile | Rename-Item -NewName {$_.Name + ".zip"} -PassThru
$url = "$baseurl/$vs/$arch/$line"
Write-Output "Downloading $url ..."
Invoke-WebRequest $url -OutFile $temp
Invoke-WebRequest $url -OutFile $temp -UseBasicParsing
Expand-Archive $temp "../deps"
$installed = $true
break
Expand Down