mirror of
				https://github.com/shivammathur/setup-php.git
				synced 2025-11-04 08:56:36 +07:00 
			
		
		
		
	Merge pull request #81 from shivammathur/develop
Fix check for existing extensions on windows
This commit is contained in:
		@ -52,9 +52,11 @@ Add-Log $tick "Composer" "Installed"
 | 
				
			|||||||
Function Add-Extension($extension, $install_command, $prefix)
 | 
					Function Add-Extension($extension, $install_command, $prefix)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  try {
 | 
					  try {
 | 
				
			||||||
    $exist = Test-Path -Path C:\tools\php\ext\php_$extension.dll
 | 
					    $existing_extensions = Get-PhpExtension -Path C:\tools\php
 | 
				
			||||||
    if(!(php -m | findstr -i ${extension}) -and $exist) {
 | 
					    $match = @($existing_extensions | Where-Object { $_.Name -like $extension })
 | 
				
			||||||
      Add-Content C:\tools\php\php.ini "$prefix=php_$extension.dll"
 | 
					    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"
 | 
					      Add-Log $tick $extension "Enabled"
 | 
				
			||||||
    } elseif(php -m | findstr -i $extension) {
 | 
					    } elseif(php -m | findstr -i $extension) {
 | 
				
			||||||
      Add-Log $tick $extension "Enabled"
 | 
					      Add-Log $tick $extension "Enabled"
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user