From d84365cd0365cc7aa6ce5dd7fd80c37ce178e562 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Mon, 10 Aug 2020 00:32:30 +0530 Subject: [PATCH] Add support for oci extensions in PHP 8 on Windows Fix cache support for oci8 on Windows --- src/scripts/ext/oci.ps1 | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/scripts/ext/oci.ps1 b/src/scripts/ext/oci.ps1 index a2e6c404..b5e3ab50 100644 --- a/src/scripts/ext/oci.ps1 +++ b/src/scripts/ext/oci.ps1 @@ -35,16 +35,19 @@ Function Add-Oci() { if ($extension -eq "pdo_oci") { Enable-PhpExtension pdo_oci -Path $php_dir } else { - $status = 'Installed and enabled' - $ociVersion = '2.2.0' - if ($version -eq '7.0') { - $ociVersion = '2.1.8' - } elseif ($version -lt '7.0') { - $ociVersion = '2.0.12' + if(-not(Test-Path $ext_dir\php_oci8.dll)) { + $status = 'Installed and enabled' + $ociVersion = '2.2.0' + if ($version -eq '7.0') { + $ociVersion = '2.1.8' + } elseif ($version -lt '7.0') { + $ociVersion = '2.0.12' + } + $ociUrl = Get-PeclArchiveUrl oci8 $ociVersion $installed + Invoke-WebRequest -UseBasicParsing -Uri $ociUrl -OutFile $php_dir\oci8.zip + Expand-Archive -Path $php_dir\oci8.zip -DestinationPath $ext_dir -Force + } - $ociUrl = Get-PeclArchiveUrl oci8 $ociVersion $installed - Invoke-WebRequest -UseBasicParsing -Uri $ociUrl -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 } Add-Log $tick $extension $status