Skip to content

Commit 47af479

Browse files
authored
fix appveyor due to changes in chocolatey php
- fix php install dir due to chocolatey versioned install directory changes for side by side installs - fix version sorting to get current minor versions - add correct caching of php and chocolatey
1 parent 1b65f36 commit 47af479

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

appveyor.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ platform:
33
- x64
44
clone_folder: c:\projects\php-project-workspace
55

6-
76
## Build matrix for lowest and highest possible targets
87
environment:
98
matrix:
@@ -14,9 +13,13 @@ environment:
1413
- dependencies: highest
1514
php_ver_target: 7.1
1615

17-
## Cache composer bits
16+
## Cache composer, chocolatey and php bits
1817
cache:
1918
- '%LOCALAPPDATA%\Composer\files -> composer.lock'
19+
- composer.phar
20+
- C:\ProgramData\chocolatey\bin -> .appveyor.yml
21+
- C:\ProgramData\chocolatey\lib -> .appveyor.yml
22+
- c:\tools\php -> .appveyor.yml
2023

2124
## Set up environment varriables
2225
init:
@@ -28,7 +31,7 @@ init:
2831
## Install PHP and composer, and run the appropriate composer command
2932
install:
3033
- IF EXIST c:\tools\php (SET PHP=0)
31-
- ps: appveyor-retry cinst -y php --ignore-checksums --version ((choco search php --exact --all-versions -r | select-string -pattern $Env:php_ver_target | Select-Object -first 1) -replace '[php|]','')
34+
- ps: appveyor-retry cinst --params '""/InstallDir:C:\tools\php""' --ignore-checksums -y php --version ((choco search php --exact --all-versions -r | select-string -pattern $env:php_ver_target | sort { [version]($_ -split '\|' | select -last 1) } -Descending | Select-Object -first 1) -replace '[php|]','')
3235
- cd c:\tools\php
3336
- IF %PHP%==1 copy php.ini-production php.ini /Y
3437
- IF %PHP%==1 echo date.timezone="UTC" >> php.ini

0 commit comments

Comments
 (0)