From f381d2384c000b73c87e033a8d5bf50c26537055 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Fri, 15 Nov 2019 20:26:07 +0530 Subject: [PATCH] Fix check for existing extensions on windows --- src/scripts/win32.ps1 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/scripts/win32.ps1 b/src/scripts/win32.ps1 index cc6a1755..9f01b365 100644 --- a/src/scripts/win32.ps1 +++ b/src/scripts/win32.ps1 @@ -52,9 +52,11 @@ Add-Log $tick "Composer" "Installed" Function Add-Extension($extension, $install_command, $prefix) { try { - $exist = Test-Path -Path C:\tools\php\ext\php_$extension.dll - if(!(php -m | findstr -i ${extension}) -and $exist) { - Add-Content C:\tools\php\php.ini "$prefix=php_$extension.dll" + $existing_extensions = Get-PhpExtension -Path C:\tools\php + $match = @($existing_extensions | Where-Object { $_.Name -like $extension }) + if(!(php -m | findstr -i ${extension}) -and $match) { + $filename = $match."Filename".split('\')[-1] + Add-Content C:\tools\php\php.ini "`n$prefix=$filename" Add-Log $tick $extension "Enabled" } elseif(php -m | findstr -i $extension) { Add-Log $tick $extension "Enabled"