Skip to content

Commit 78a1e42

Browse files
committed
ci(appveyor): use Download-File for XDebug too
1 parent 5f8793b commit 78a1e42

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

appveyor-install.ps1

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11

22
# Install PHP
3-
$target = Join-Path $PWD 'php.zip'
4-
function Download-PHP ([string] $phpUrl) {
3+
function Download-File ([string] $Url, [string] $Target) {
54
$client = New-Object System.Net.WebClient
65
$client.Headers.Add('User-Agent', "AppVeyor CI PowerShell $($PSVersionTable.PSVersion) $([Environment]::OSVersion.VersionString)")
7-
Write-Output "Downloading $phpUrl"
8-
$client.DownloadFile($phpUrl, $target)
6+
Write-Output "Downloading $Url"
7+
$client.DownloadFile($Url, $Target)
98
}
9+
$phpTarget = Join-Path $PWD 'php.zip'
1010
try {
11-
Download-PHP "http://windows.php.net/downloads/releases/php-$env:PHP_VERSION-nts-Win32-VC$env:VC_VERSION-x86.zip"
11+
Download-File "http://windows.php.net/downloads/releases/php-$env:PHP_VERSION-nts-Win32-VC$env:VC_VERSION-x86.zip" $phpTarget
1212
}
1313
catch [System.Net.WebException] {
1414
if ($_.Exception.Response.StatusCode.Value__ -eq 404) {
1515
# Older releases get moved to archives/
16-
Download-PHP "http://windows.php.net/downloads/releases/archives/php-$env:PHP_VERSION-nts-Win32-VC$env:VC_VERSION-x86.zip"
16+
Download-File "http://windows.php.net/downloads/releases/archives/php-$env:PHP_VERSION-nts-Win32-VC$env:VC_VERSION-x86.zip" $phpTarget
1717
Write-Warning "PHP $env:PHP_VERSION is outdated and was moved to archives"
1818
}
1919
else {
@@ -33,7 +33,7 @@ $phpMinorVersion = $env:PHP_VERSION -replace '\.\d+$'
3333
$xdebugUrl = "https://xdebug.org/files/php_xdebug-$env:XDEBUG_VERSION-$phpMinorVersion-vc$env:VC_VERSION-nts.dll"
3434
Write-Output "Downloading $xdebugUrl"
3535
$xdebugPath = Join-Path $PWD 'php\ext\xdebug.dll'
36-
$client.DownloadFile($xdebugUrl, $xdebugPath)
36+
Download-File $xdebugUrl $xdebugPath
3737
Add-Content .\php\php.ini @"
3838
extension_dir=ext
3939
zend_extension=$xdebugPath

0 commit comments

Comments
 (0)