mirror of
https://github.com/actions/runner-images.git
synced 2025-12-14 13:17:54 +00:00
[Windows] Implement new directories hierarchy (#8616)
This commit is contained in:
committed by
GitHub
parent
84a7deae24
commit
d1f2c9a3be
22
images/windows/scripts/build/Install-PHP.ps1
Normal file
22
images/windows/scripts/build/Install-PHP.ps1
Normal file
@@ -0,0 +1,22 @@
|
||||
################################################################################
|
||||
## File: Install-PHP.ps1
|
||||
## Desc: Install PHP
|
||||
################################################################################
|
||||
|
||||
# Install latest PHP in chocolatey
|
||||
$installDir = "c:\tools\php"
|
||||
$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
|
||||
Choco-Install -PackageName composer -ArgumentList "--ia", "/DEV=$installDir /PHP=$installDir"
|
||||
|
||||
# update path to extensions and enable curl and mbstring extensions, and enable php openssl extensions.
|
||||
((Get-Content -path $installDir\php.ini -Raw) -replace ';extension=curl','extension=curl' -replace ';extension=mbstring','extension=mbstring' -replace ';extension_dir = "ext"','extension_dir = "ext"' -replace ';extension=openssl','extension=openssl') | Set-Content -Path $installDir\php.ini
|
||||
|
||||
# Set the PHPROOT environment variable.
|
||||
setx PHPROOT $installDir /M
|
||||
|
||||
# Invoke Pester Tests
|
||||
Invoke-PesterTests -TestFile "PHP"
|
||||
Reference in New Issue
Block a user