From 95be7a9cfc343f6ad4cb1a23626896419b40371c Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Sun, 16 Feb 2020 08:00:05 +0530 Subject: [PATCH] Use Custom build for 5.3 and 5.3 on windows --- README.md | 2 +- src/scripts/win32.ps1 | 29 ++++++++++++++--------------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index aad4b8ff..82f2c645 100644 --- a/README.md +++ b/README.md @@ -292,7 +292,7 @@ steps: - `NTS` versions are setup by default. - On `ubuntu` and `macOS` only NTS versions are supported. -- On `windows` both `TS` and `NTS` versions are supported. +- On `windows` both `TS` and `NTS` versions are supported for PHP 5.5 and above. ```yaml jobs: diff --git a/src/scripts/win32.ps1 b/src/scripts/win32.ps1 index 6f990a6b..27637a98 100644 --- a/src/scripts/win32.ps1 +++ b/src/scripts/win32.ps1 @@ -177,6 +177,7 @@ if((Test-Path env:PHPTS) -and $env:PHPTS -eq 'ts') { $ts = $true } +Remove-Item $php_dir\* -Recurse Step-Log "Setup PhpManager" Install-Module -Name PhpManager -Force -Scope CurrentUser Add-Log $tick "PhpManager" "Installed" @@ -192,15 +193,20 @@ if (Test-Path -LiteralPath $php_dir -PathType Container) { Step-Log "Setup PHP" $status = "Installed" if ($null -eq $installed -or -not("$($installed.Version).".StartsWith(($version -replace '^(\d+(\.\d+)*).*', '$1.'))) -or $ts -ne $installed.ThreadSafe) { - if ($version -lt '7.0') { - Install-Module -Name VcRedist -Force - $arch='x86' + if ($version -lt "5.5"){ + $bintray = "https://dl.bintray.com/shivammathur/php" + Invoke-WebRequest -UseBasicParsing -Uri $bintray/php$version.7z -OutFile C:\tools\php$version.7z > $null 2>&1 + 7z x C:\tools\php$version.7z -oC:\tools\ > $null 2>&1 + } else { + if ($version -lt '7.0') { + Install-Module -Name VcRedist -Force + $arch='x86' + } + if ($version -eq $master_version) { $version = 'master' } + Install-Php -Version $version -Architecture $arch -ThreadSafe $ts -InstallVC -Path $php_dir -TimeZone UTC -InitialPhpIni Production -Force > $null 2>&1 + Set-PhpIniKey -Key 'date.timezone' -Value 'UTC' -Path $php_dir + Enable-PhpExtension -Extension openssl, curl, opcache -Path $php_dir } - if ($version -eq $master_version) { - $version = 'master' - } - - Install-Php -Version $version -Architecture $arch -ThreadSafe $ts -InstallVC -Path $php_dir -TimeZone UTC -InitialPhpIni Production -Force >$null 2>&1 } else { if((Test-Path env:update) -and $env:update -eq 'true') { Update-Php $php_dir > $null 2>&1 @@ -211,13 +217,6 @@ if ($null -eq $installed -or -not("$($installed.Version).".StartsWith(($version } $installed = Get-Php -Path $php_dir -Set-PhpIniKey -Key 'date.timezone' -Value 'UTC' -Path $php_dir -if($version -lt "5.5") { - Add-Extension openssl >$null 2>&1 - Add-Extension curl >$null 2>&1 -} else { - Enable-PhpExtension -Extension openssl, curl, opcache -Path $php_dir -} Update-PhpCAInfo -Path $php_dir -Source CurrentUser if ($version -eq 'master') { if($installed.ThreadSafe) {