File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- $client = New-Object System.Net.WebClient
1+ $ErrorActionPreference = ' Stop '
22
33# Install PHP
4+ $client = New-Object System.Net.WebClient
45$phpUrl = " http://windows.php.net/downloads/releases/php-$env: PHP_VERSION -nts-Win32-VC$env: VC_VERSION -x86.zip"
56$target = Join-Path $PWD ' php.zip'
67Write-Output " Downloading $phpUrl "
78try {
89 $client.DownloadFile ($phpUrl , $target )
9- } catch [System.Net.WebException ] {
10+ }
11+ catch [System.Net.WebException ] {
1012 if ($_.Exception.Response.StatusCode.Value__ -eq 404 ) {
1113 # Older releases get moved to archives/
1214 $phpUrl = " http://windows.php.net/downloads/releases/archives/php-$env: PHP_VERSION -nts-Win32-VC$env: VC_VERSION -x86.zip"
1315 Write-Output " Downloading $phpUrl "
1416 $client.DownloadFile ($phpUrl , $target )
1517 Write-Warning " PHP $env: PHP_VERSION is outdated and was moved to archives"
16- } else {
18+ }
19+ else {
1720 throw $_
1821 }
1922}
20237z e php.zip - ophp
24+ if ($LASTEXITCODE -ne 0 ) {
25+ throw " 7zip exited with $LASTEXITCODE "
26+ }
2127Rename-Item .\php\php.ini- development php.ini
2228$env: PATH += ' ;' + (Join-Path $PWD ' php' )
2329
You can’t perform that action at this time.
0 commit comments