mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-22 20:01:06 +07:00
Add support for specifying nts/ts builds on windows
This commit is contained in:
parent
b44e5e009f
commit
e9c783eef0
Binary file not shown.
BIN
src/bin/php_ts_pcov.dll
Normal file
BIN
src/bin/php_ts_pcov.dll
Normal file
Binary file not shown.
@ -156,7 +156,11 @@ $php_dir = 'C:\tools\php'
|
||||
$ext_dir = $php_dir + '\ext'
|
||||
$ProgressPreference = 'SilentlyContinue'
|
||||
$master_version = '8.0'
|
||||
$arch='x64'
|
||||
$arch = 'x64'
|
||||
$ts = $false
|
||||
if((Test-Path env:PHPTS) -and $env:PHPTS -eq 'ts') {
|
||||
$ts = $true
|
||||
}
|
||||
|
||||
Step-Log "Setup PhpManager"
|
||||
Install-Module -Name PhpManager -Force -Scope CurrentUser
|
||||
@ -172,7 +176,7 @@ 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.')))) {
|
||||
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'
|
||||
@ -181,7 +185,7 @@ if ($null -eq $installed -or -not("$($installed.Version).".StartsWith(($version
|
||||
$version = 'master'
|
||||
}
|
||||
|
||||
Install-Php -Version $version -Architecture $arch -ThreadSafe $true -InstallVC -Path $php_dir -TimeZone UTC -InitialPhpIni Production -Force >$null 2>&1
|
||||
Install-Php -Version $version -Architecture $arch -ThreadSafe $ts -InstallVC -Path $php_dir -TimeZone UTC -InitialPhpIni Production -Force >$null 2>&1
|
||||
} else {
|
||||
$updated = Update-Php $php_dir >$null 2>&1
|
||||
if($updated -eq $False) {
|
||||
@ -194,7 +198,11 @@ Set-PhpIniKey -Key 'date.timezone' -Value 'UTC' -Path $php_dir
|
||||
Enable-PhpExtension -Extension openssl, curl, opcache -Path $php_dir
|
||||
Update-PhpCAInfo -Path $php_dir -Source CurrentUser
|
||||
if ($version -eq 'master') {
|
||||
if($installed.ThreadSafe) {
|
||||
Copy-Item $dir"\..\src\bin\php_ts_pcov.dll" -Destination $ext_dir"\php_pcov.dll"
|
||||
} else {
|
||||
Copy-Item $dir"\..\src\bin\php_pcov.dll" -Destination $ext_dir"\php_pcov.dll"
|
||||
}
|
||||
Set-PhpIniKey -Key 'opcache.jit_buffer_size' -Value '256M' -Path $php_dir
|
||||
Set-PhpIniKey -Key 'opcache.jit' -Value '1235' -Path $php_dir
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user