mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-23 04:11:06 +07:00
Exit on failing to setup PHP
This commit is contained in:
parent
20b87bc786
commit
678ad243bf
@ -279,6 +279,10 @@ ext_dir=$(php -i | grep -Ei "extension_dir => /" | sed -e "s|.*=> s*||")
|
|||||||
scan_dir=$(php --ini | grep additional | sed -e "s|.*: s*||")
|
scan_dir=$(php --ini | grep additional | sed -e "s|.*: s*||")
|
||||||
sudo mkdir -m 777 -p "$ext_dir" "$HOME/.composer"
|
sudo mkdir -m 777 -p "$ext_dir" "$HOME/.composer"
|
||||||
semver=$(php -v | head -n 1 | cut -f 2 -d ' ')
|
semver=$(php -v | head -n 1 | cut -f 2 -d ' ')
|
||||||
|
if [ "${semver%.*}" != "$version" ]; then
|
||||||
|
add_log "$cross" "PHP" "Could not setup PHP $version"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
configure_pecl
|
configure_pecl
|
||||||
sudo cp "$dist"/../src/configs/*.json "$RUNNER_TOOL_CACHE/"
|
sudo cp "$dist"/../src/configs/*.json "$RUNNER_TOOL_CACHE/"
|
||||||
add_log "$tick" "PHP" "$status PHP $semver"
|
add_log "$tick" "PHP" "$status PHP $semver"
|
||||||
|
@ -307,6 +307,10 @@ else
|
|||||||
status="Found"
|
status="Found"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if ! command -v php"$version" >/dev/null; then
|
||||||
|
add_log "$cross" "PHP" "Could not setup PHP $version"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
semver=$(php_semver)
|
semver=$(php_semver)
|
||||||
scan_dir=$(php --ini | grep additional | sed -e "s|.*: s*||")
|
scan_dir=$(php --ini | grep additional | sed -e "s|.*: s*||")
|
||||||
ini_file=$(php --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g")
|
ini_file=$(php --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g")
|
||||||
|
@ -288,18 +288,24 @@ if ($null -eq $installed -or -not("$($installed.Version).".StartsWith(($version
|
|||||||
Install-PSPackage VcRedist VcRedist-main\VcRedist\VcRedist "$github/aaronparker/VcRedist/archive/main.zip" >$null 2>&1
|
Install-PSPackage VcRedist VcRedist-main\VcRedist\VcRedist "$github/aaronparker/VcRedist/archive/main.zip" >$null 2>&1
|
||||||
$arch='x86'
|
$arch='x86'
|
||||||
}
|
}
|
||||||
if ($version -eq $master_version) {
|
try {
|
||||||
$version = 'master'
|
if ($version -eq $master_version) {
|
||||||
Invoke-WebRequest -UseBasicParsing -Uri https://github.com/shivammathur/php-builder-windows/releases/latest/download/Get-Php.ps1 -OutFile $php_dir\Get-Php.ps1 > $null 2>&1
|
$version = 'master'
|
||||||
& $php_dir\Get-Php.ps1 -Architecture $arch -ThreadSafe $ts -Path $php_dir
|
Invoke-WebRequest -UseBasicParsing -Uri https://github.com/shivammathur/php-builder-windows/releases/latest/download/Get-Php.ps1 -OutFile $php_dir\Get-Php.ps1 > $null 2>&1
|
||||||
} else {
|
& $php_dir\Get-Php.ps1 -Architecture $arch -ThreadSafe $ts -Path $php_dir
|
||||||
Install-Php -Version $version -Architecture $arch -ThreadSafe $ts -InstallVC -Path $php_dir -TimeZone UTC -InitialPhpIni Production -Force > $null 2>&1
|
} else {
|
||||||
}
|
Install-Php -Version $version -Architecture $arch -ThreadSafe $ts -InstallVC -Path $php_dir -TimeZone UTC -InitialPhpIni Production -Force > $null 2>&1
|
||||||
|
}
|
||||||
|
} catch { }
|
||||||
} else {
|
} else {
|
||||||
$status = "Found"
|
$status = "Found"
|
||||||
}
|
}
|
||||||
|
|
||||||
$installed = Get-Php -Path $php_dir
|
$installed = Get-Php -Path $php_dir
|
||||||
|
if($installed.MajorMinorVersion -ne $version) {
|
||||||
|
Add-Log $cross "PHP" "Could not setup PHP $version"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
('date.timezone=UTC', 'memory_limit=-1', 'xdebug.mode=coverage') | ForEach-Object { $p=$_.split('='); Set-PhpIniKey -Key $p[0] -Value $p[1] -Path $php_dir }
|
('date.timezone=UTC', 'memory_limit=-1', 'xdebug.mode=coverage') | ForEach-Object { $p=$_.split('='); Set-PhpIniKey -Key $p[0] -Value $p[1] -Path $php_dir }
|
||||||
# Patch till there is a pcov DLL for PHP 8.0 on pecl
|
# Patch till there is a pcov DLL for PHP 8.0 on pecl
|
||||||
if ($version -eq '8.0') {
|
if ($version -eq '8.0') {
|
||||||
|
Loading…
Reference in New Issue
Block a user