From 874e5099b099951cf0be74473410a007184b5b9b Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Thu, 11 Nov 2021 19:22:29 +0530 Subject: [PATCH] Stop using Install-PhpExtensionPrerequisite for imagick --- src/scripts/win32.ps1 | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/src/scripts/win32.ps1 b/src/scripts/win32.ps1 index fd71c83fe..cd648b73b 100644 --- a/src/scripts/win32.ps1 +++ b/src/scripts/win32.ps1 @@ -141,26 +141,6 @@ Function Set-ExtensionPrerequisites } } -# Function to get extension pre-requisites. -# https://windows.php.net/downloads/pecl/deps -# Currently only imagick is supported using this Cmdlet. -Function Get-ExtensionPrerequisites{ - Param ( - [Parameter(Position = 0, Mandatory = $true)] - [ValidateNotNull()] - [ValidateLength(1, [int]::MaxValue)] - [string] - $extension - ) - $deps_dir = "$ext_dir\$extension-vc$($installed.VCVersion)-$arch" - $extensions_with_dependencies = ('imagick') - New-Item $deps_dir -Type Directory -Force > $null 2>&1 - if($extensions_with_dependencies.Contains($extension)) { - Install-PhpExtensionPrerequisite -Extension $extension -InstallPath $deps_dir -PhpPath $php_dir - } - return $deps_dir -} - # Function to add CA certificates to PHP. Function Add-PhpCAInfo { try { @@ -192,6 +172,8 @@ Function Add-Extension { ) try { $extension_info = Get-PhpExtension -Path $php_dir | Where-Object { $_.Name -eq $extension -or $_.Handle -eq $extension } + $deps_dir = "$ext_dir\$extension-vc$($installed.VCVersion)-$arch" + New-Item $deps_dir -Type Directory -Force > $null 2>&1 if ($null -ne $extension_info) { switch ($extension_info.State) { 'Builtin' { @@ -201,7 +183,6 @@ Function Add-Extension { Add-Log $tick $extension "Enabled" } default { - $deps_dir = Get-ExtensionPrerequisites $extension Enable-ExtensionDependencies $extension Enable-PhpExtension -Extension $extension_info.Handle -Path $php_dir Set-ExtensionPrerequisites $deps_dir @@ -210,7 +191,6 @@ Function Add-Extension { } } else { - $deps_dir = Get-ExtensionPrerequisites $extension $params = @{ Extension = $extension; MinimumStability = $stability; MaximumStability = $stability; Path = $php_dir; AdditionalFilesPath = $deps_dir; NoDependencies = $true } if($extension_version -ne '') { $params["Version"] = $extension_version