mirror of
				https://github.com/shivammathur/setup-php.git
				synced 2025-10-30 23:07:56 +07:00 
			
		
		
		
	Fix installing xdebug with PHP 7.4 on Windows
This commit is contained in:
		| @ -50,7 +50,14 @@ export async function addExtensionWindows( | ||||
|   let script = '\n'; | ||||
|   await utils.asyncForEach(extensions, async function(extension: string) { | ||||
|     // add script to enable extension is already installed along with php | ||||
|     script += '\nAdd-Extension ' + extension; | ||||
|     let minimum_stability = 'stable'; | ||||
|     switch (version + extension.toLowerCase()) { | ||||
|       case '7.4xdebug': | ||||
|         minimum_stability = 'beta'; | ||||
|         break; | ||||
|     } | ||||
|     script += ` | ||||
| Add-Extension ${extension} ${minimum_stability}`; | ||||
|   }); | ||||
|   return script; | ||||
| } | ||||
|  | ||||
| @ -59,7 +59,7 @@ Add-Log $tick "PHP" $status | ||||
| Install-Composer -Scope System -Path $php_dir -PhpPath $php_dir | ||||
| Add-Log $tick "Composer" "Installed" | ||||
|  | ||||
| Function Add-Extension($extension) { | ||||
| Function Add-Extension($extension, $mininum_stability) { | ||||
|   try { | ||||
|     $extension_info = Get-PhpExtension -Path $php_dir | Where-Object { $_.Name -eq $extension -or $_.Handle -eq $extension } | ||||
|     if ($null -ne $extension_info) { | ||||
| @ -77,7 +77,7 @@ Function Add-Extension($extension) { | ||||
|       } | ||||
|     } | ||||
|     else { | ||||
|       Install-PhpExtension -Extension $extension -Path $php_dir | ||||
|       Install-PhpExtension -Extension $extension -MinimumStability $mininum_stability -Path $php_dir | ||||
|       Add-Log $tick $extension "Downloaded and enabled" | ||||
|     } | ||||
|   } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Michele Locati
					Michele Locati