mirror of
https://github.com/shivammathur/setup-php.git
synced 2025-01-18 22:31:45 +07:00
Fix oci extension support on Windows for PHP 8.4 and above
This commit is contained in:
parent
96fb539134
commit
5bb2eed0aa
@ -136,6 +136,10 @@ Function Add-Extension {
|
|||||||
{
|
{
|
||||||
$params["Version"] = $extension_version
|
$params["Version"] = $extension_version
|
||||||
}
|
}
|
||||||
|
# If extension for a different version exists
|
||||||
|
if(Test-Path $ext_dir\php_$extension.dll) {
|
||||||
|
Move-Item $ext_dir\php_$extension.dll $ext_dir\php_$extension.bak.dll -Force
|
||||||
|
}
|
||||||
Install-PhpExtension @params
|
Install-PhpExtension @params
|
||||||
Set-ExtensionPrerequisites $extension
|
Set-ExtensionPrerequisites $extension
|
||||||
}
|
}
|
||||||
|
@ -48,6 +48,7 @@ Function Get-Oci8DLL() {
|
|||||||
return $_
|
return $_
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return $null
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to install oci8 and pdo_oci.
|
# Function to install oci8 and pdo_oci.
|
||||||
@ -62,22 +63,17 @@ Function Add-Oci() {
|
|||||||
try {
|
try {
|
||||||
$status = 'Enabled'
|
$status = 'Enabled'
|
||||||
Add-InstantClient
|
Add-InstantClient
|
||||||
if ($extension -eq "pdo_oci") {
|
if($version -lt '8.4') {
|
||||||
Enable-PhpExtension pdo_oci -Path $php_dir
|
if($version -lt '5.6' -and $extension -eq 'oci8') {
|
||||||
} else {
|
Add-Content -Value "`r`nextension=php_oci8.dll" -Path $php_dir\php.ini
|
||||||
if(-not(Test-Path $ext_dir\php_oci8.dll)) {
|
} else {
|
||||||
$oci8DLL = Get-Oci8DLL
|
Enable-PhpExtension $extension -Path $php_dir
|
||||||
if($oci8DLL) {
|
|
||||||
Copy-Item -Path $oci8DLL -Destination $ext_dir\php_oci8.dll
|
|
||||||
} else {
|
|
||||||
$status = 'Installed and enabled'
|
|
||||||
Get-File -Url (Get-Oci8Url) -OutFile $php_dir\oci8.zip
|
|
||||||
Expand-Archive -Path $php_dir\oci8.zip -DestinationPath $ext_dir -Force
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Add-Content -Value "`r`nextension=php_oci8.dll" -Path $php_dir\php.ini
|
} else {
|
||||||
|
$status = 'Installed and enabled'
|
||||||
|
Add-Extension $extension >$null 2>&1
|
||||||
}
|
}
|
||||||
Add-Log $tick $extension $status
|
Add-ExtensionLog $extension $status
|
||||||
Add-LicenseLog
|
Add-LicenseLog
|
||||||
} catch {
|
} catch {
|
||||||
Add-Log $cross $extension "Could not install $extension on PHP $( $installed.FullVersion )"
|
Add-Log $cross $extension "Could not install $extension on PHP $( $installed.FullVersion )"
|
||||||
|
Loading…
Reference in New Issue
Block a user