[Windows] Add PHP to the toolset (#4493)

This commit is contained in:
V-Zabayrachny
2021-11-16 11:32:09 +03:00
committed by GitHub
parent 06c90a3200
commit d3e74a5d7d
5 changed files with 21 additions and 7 deletions

View File

@@ -5,7 +5,9 @@
# Install latest PHP in chocolatey # Install latest PHP in chocolatey
$installDir = "c:\tools\php" $installDir = "c:\tools\php"
Choco-Install -PackageName php -ArgumentList "--force", "--params", "/InstallDir:$installDir" $phpMajorMinor = (Get-ToolsetContent).php.version
$phpVersionToInstall = Get-LatestChocoPackageVersion -TargetVersion $phpMajorMinor -PackageName "php"
Choco-Install -PackageName php -ArgumentList "--params", "/InstallDir:$installDir", "--version=$phpVersionToInstall"
# Install latest Composer in chocolatey # Install latest Composer in chocolatey
Choco-Install -PackageName composer -ArgumentList "--ia", "/DEV=$installDir /PHP=$installDir" Choco-Install -PackageName composer -ArgumentList "--ia", "/DEV=$installDir /PHP=$installDir"

View File

@@ -1,9 +1,12 @@
Describe "PHP" { Describe "PHP" {
It "Check <ToolName> in the PATH" -TestCases @( It "Check PHP version" {
@{ ToolName = "php" } $phpMajorMinor = (Get-ToolsetContent).php.version
@{ ToolName = "composer" } $phpInstalledVersion = php --version | Select-String -Pattern "PHP $phpMajorMinor"
) { $phpInstalledVersion | Should -BeLike "*${phpMajorMinor}*"
"$ToolName --version" | Should -ReturnZeroExitCode }
It "Check Composer in the PATH" {
"composer --version" | Should -ReturnZeroExitCode
} }
It "PHP Environment variables is set." { It "PHP Environment variables is set." {

View File

@@ -427,6 +427,9 @@
"mongodb": { "mongodb": {
"version": "5.0" "version": "5.0"
}, },
"php": {
"version": "8.0"
},
"llvm": { "llvm": {
"version": "13" "version": "13"
} }

View File

@@ -459,6 +459,9 @@
"mongodb": { "mongodb": {
"version": "5.0" "version": "5.0"
}, },
"php": {
"version": "8.0"
},
"llvm": { "llvm": {
"version": "13" "version": "13"
} }

View File

@@ -310,5 +310,8 @@
}, },
"mongodb": { "mongodb": {
"version": "5.0" "version": "5.0"
},
"php": {
"version": "8.0"
} }
} }