Skip to content

Commit

Permalink
Merge pull request #3 from alcaeus/archive-old-php
Browse files Browse the repository at this point in the history
Archive PHP 7.4 and 8.0
  • Loading branch information
cmb69 authored Jul 8, 2024
2 parents 575941f + 3b455e4 commit 9cf03b8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ $releases = @{
"7.1" = "7.1.33"
"7.2" = "7.2.34"
"7.3" = "7.3.33"
"7.4" = "7.4.33"
"8.0" = "8.0.30"
}
$phpversion = $releases.$version
if (-not $phpversion) {
Expand All @@ -83,6 +85,7 @@ Write-Output "Install PHP $phpversion ..."
$temp = New-TemporaryFile | Rename-Item -NewName {$_.Name + ".zip"} -PassThru
$fname = "php-$phpversion-$tspart-$vs-$arch.zip"
$url = "$baseurl/$fname"
Write-Output "Downloading $url ..."
Invoke-WebRequest $url -OutFile $temp
Expand-Archive $temp "php-bin"

Expand All @@ -91,6 +94,7 @@ Write-Output "Install development pack ..."
$temp = New-TemporaryFile | Rename-Item -NewName {$_.Name + ".zip"} -PassThru
$fname = "php-devel-pack-$phpversion-$tspart-$vs-$arch.zip"
$url = "$baseurl/$fname"
Write-Output "Downloading $url ..."
Invoke-WebRequest $url -OutFile $temp
Expand-Archive $temp "."
Rename-Item "php-$phpversion-devel-$vs-$arch" "php-dev"
Expand All @@ -103,9 +107,11 @@ if ($deps.Count -gt 0) {
foreach ($dep in $deps) {
foreach ($line in ($series.Content -Split "[\r\n]+")) {
if ($line -match "^$dep") {
Write-Output "Install $line"
Write-Output "Install $line ..."
$temp = New-TemporaryFile | Rename-Item -NewName {$_.Name + ".zip"} -PassThru
Invoke-WebRequest "$baseurl/$vs/$arch/$line" -OutFile $temp
$url = "$baseurl/$vs/$arch/$line"
Write-Output "Downloading $url ..."
Invoke-WebRequest $url -OutFile $temp
Expand-Archive $temp "../deps"
$installed = $true
break
Expand Down

0 comments on commit 9cf03b8

Please sign in to comment.