From d502a6095be92f92b85a02e5146585fa1d29430e Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Fri, 5 Jul 2024 18:33:59 +0200 Subject: [PATCH] Add support for PHP 8.4 (alpha) --- PhpManager/private/Get-PhpVersionFromApiVersion.ps1 | 10 +++++++--- PhpManager/private/PhpVersion.ps1 | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/PhpManager/private/Get-PhpVersionFromApiVersion.ps1 b/PhpManager/private/Get-PhpVersionFromApiVersion.ps1 index 46a9dcd..e407081 100644 --- a/PhpManager/private/Get-PhpVersionFromApiVersion.ps1 +++ b/PhpManager/private/Get-PhpVersionFromApiVersion.ps1 @@ -16,18 +16,22 @@ function Get-PhpVersionFromApiVersion { return '' } switch ($ApiVersion) { + # https://github.com/php/php-src/blob/php-8.4.0alpha1/Zend/zend_modules.h#L34 + 20230901 { + return '8.4' + } # https://github.com/php/php-src/blob/php-8.3.0RC1/Zend/zend_modules.h#L34 - # https://github.com/php/php-src/blob/php-8.3.7/Zend/zend_modules.h#L34 + # https://github.com/php/php-src/blob/php-8.3.9/Zend/zend_modules.h#L34 20230831 { return '8.3' } # https://github.com/php/php-src/blob/php-8.2.0RC1/Zend/zend_modules.h#L34 - # https://github.com/php/php-src/blob/php-8.2.19/Zend/zend_modules.h#L34 + # https://github.com/php/php-src/blob/php-8.2.21/Zend/zend_modules.h#L34 20220829 { return '8.2' } # https://github.com/php/php-src/blob/php-8.1.0RC1/Zend/zend_modules.h#L34 - # https://github.com/php/php-src/blob/php-8.1.28/Zend/zend_modules.h#L34 + # https://github.com/php/php-src/blob/php-8.1.29/Zend/zend_modules.h#L34 20210902 { return '8.1' } diff --git a/PhpManager/private/PhpVersion.ps1 b/PhpManager/private/PhpVersion.ps1 index b13443c..fe13f62 100644 --- a/PhpManager/private/PhpVersion.ps1 +++ b/PhpManager/private/PhpVersion.ps1 @@ -324,7 +324,7 @@ echo PHP_VERSION, chr(9), PHP_INT_SIZE * 8, chr(9), $matches[1]; $executableResult = & $data.ExecutablePath @('-i') $match = $executableResult | Select-String -CaseSensitive -Pattern '^[ \t]*Thread Safety\s*=>\s*(\w+)' $data.ThreadSafe = $match.Matches.Groups[1].Value -eq 'enabled' - $match = $executableResult | Select-String -CaseSensitive -Pattern '^[ \t]*Compiler\s*=>\s*MSVC([\d]{1,2})' + $match = $executableResult | Select-String -CaseSensitive -Pattern '^[ \t]*Compiler\s*=>\s*MSVC ?([\d]{1,2})' if ($null -ne $match) { $data.VCVersion = $match.Matches.Groups[1].Value } elseif ([System.Version]$data.Version -le [System.Version]'5.2.9999') {