Skip to content

Commit

Permalink
Refactor PHP nightly setup in Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
shivammathur committed Jan 27, 2022
1 parent c1efd61 commit da21b56
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/scripts/win32.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,16 @@ Function Set-PhpCache {
} catch { }
}

# Function to install nightly version of PHP
Function Install-PhpNightly {
Invoke-WebRequest -UseBasicParsing -Uri $php_builder/releases/latest/download/Get-PhpNightly.ps1 -OutFile $php_dir\Get-PhpNightly.ps1 > $null 2>&1
& $php_dir\Get-PhpNightly.ps1 -Architecture $arch -ThreadSafe $ts -Path $php_dir -Version $version > $null 2>&1
if(Test-Path $php_dir\COMMIT) {
return " ($( Get-Content $php_dir\COMMIT ))"
}
return;
}

# Variables
$tick = ([char]8730)
$cross = ([char]10007)
Expand Down Expand Up @@ -280,11 +290,7 @@ if ($null -eq $installed -or -not("$($installed.Version).".StartsWith(($version
}
try {
if ($version -match $nightly_versions) {
Invoke-WebRequest -UseBasicParsing -Uri $php_builder/releases/latest/download/Get-PhpNightly.ps1 -OutFile $php_dir\Get-PhpNightly.ps1 > $null 2>&1
& $php_dir\Get-PhpNightly.ps1 -Architecture $arch -ThreadSafe $ts -Path $php_dir -Version $version > $null 2>&1
if(Test-Path $php_dir\COMMIT) {
$extra_version = " ($( Get-Content $php_dir\COMMIT ))"
}
$extra_version = Install-PhpNightly
} else {
Set-PhpCache
Install-Php -Version $version -Architecture $arch -ThreadSafe $ts -InstallVC -Path $php_dir -TimeZone UTC -InitialPhpIni production -Force > $null 2>&1
Expand Down

0 comments on commit da21b56

Please sign in to comment.