mirror of
https://github.com/actions/runner-images.git
synced 2025-12-13 20:56:47 +00:00
* [Windows] Refactor base Installer helper functions * Fix helper name * Fix name gen logic and improve error handling * Fix hash checking logic * Fix Install-VsixExtension invocation * Fix variable name in Install-OpenSSL.ps1 * Fix type for git downloadUrl
23 lines
1.2 KiB
PowerShell
23 lines
1.2 KiB
PowerShell
################################################################################
|
|
## File: Install-PHP.ps1
|
|
## Desc: Install PHP
|
|
################################################################################
|
|
|
|
# Install latest PHP in chocolatey
|
|
$installDir = "c:\tools\php"
|
|
$phpMajorMinor = (Get-ToolsetContent).php.version
|
|
$phpVersionToInstall = Resolve-ChocoPackageVersion -PackageName "php" -TargetVersion $phpMajorMinor
|
|
Install-ChocoPackage php -ArgumentList "--params", "/InstallDir:$installDir", "--version=$phpVersionToInstall"
|
|
|
|
# Install latest Composer in chocolatey
|
|
Install-ChocoPackage composer -ArgumentList "--install-args", "/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.
|
|
[Environment]::SetEnvironmentVariable("PHPROOT", $installDir, "Machine")
|
|
|
|
# Invoke Pester Tests
|
|
Invoke-PesterTests -TestFile "PHP"
|