diff --git a/src/bin/php_pcov.dll b/src/bin/php_pcov.dll index f6becd73..8c21d116 100644 Binary files a/src/bin/php_pcov.dll and b/src/bin/php_pcov.dll differ diff --git a/src/bin/php_ts_pcov.dll b/src/bin/php_ts_pcov.dll new file mode 100644 index 00000000..79291a88 Binary files /dev/null and b/src/bin/php_ts_pcov.dll differ diff --git a/src/scripts/win32.ps1 b/src/scripts/win32.ps1 index 0dea59bb..e3b3f289 100644 --- a/src/scripts/win32.ps1 +++ b/src/scripts/win32.ps1 @@ -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') { - Copy-Item $dir"\..\src\bin\php_pcov.dll" -Destination $ext_dir"\php_pcov.dll" + 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 }