mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-22 20:01:06 +07:00
Add debug symbols support to Windows
This commit is contained in:
parent
bbc6e9069b
commit
48fb8e1194
@ -229,6 +229,20 @@ Function Set-PhpCache {
|
||||
} catch { }
|
||||
}
|
||||
|
||||
# Function to add debug symbols to PHP.
|
||||
Function Add-DebugSymbols {
|
||||
$release = Invoke-RestMethod https://api.github.com/repos/shivammathur/php-builder-windows/releases/tags/php$version
|
||||
$dev = if ($version -match $nightly_versions) { '-dev' } else { '' }
|
||||
$asset = $release.assets | ForEach-Object {
|
||||
if($_.name -match "php-debug-pack-$version.[0-9]+$dev$env:PHPTS-Win32-.*-$arch.zip") {
|
||||
return $_.name
|
||||
}
|
||||
}
|
||||
Invoke-WebRequest -UseBasicParsing -Uri $php_builder/releases/download/php$version/$asset -OutFile $php_dir\$asset
|
||||
Expand-Archive -Path $php_dir\$asset -DestinationPath $php_dir -Force
|
||||
Get-ChildItem -Path $php_dir -Filter php_*.pdb | Move-Item -Destination $ext_dir
|
||||
}
|
||||
|
||||
# Function to install nightly version of PHP
|
||||
Function Install-PhpNightly {
|
||||
Invoke-WebRequest -UseBasicParsing -Uri $php_builder/releases/latest/download/Get-PhpNightly.ps1 -OutFile $php_dir\Get-PhpNightly.ps1 > $null 2>&1
|
||||
@ -351,6 +365,10 @@ if ($null -eq $installed -or -not("$($installed.Version).".StartsWith(($version
|
||||
Add-PhpConfig
|
||||
}
|
||||
|
||||
if($env:DEBUG -eq 'true') {
|
||||
Add-DebugSymbols
|
||||
}
|
||||
|
||||
$installed = Get-Php -Path $php_dir
|
||||
if($installed.MajorMinorVersion -ne $version) {
|
||||
Add-Log $cross "PHP" "Could not setup PHP $version"
|
||||
|
Loading…
Reference in New Issue
Block a user