mirror of
https://github.com/shivammathur/setup-php.git
synced 2026-08-29 02:10:24 +07:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 20f54cb8d0 |
@@ -174,6 +174,11 @@ get_brewed_php() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Function to setup PHP from the cached builds.
|
||||||
|
setup_cached_versions() {
|
||||||
|
run_script "php-darwin" "$version" "${debug:?}" "${ts:?}"
|
||||||
|
}
|
||||||
|
|
||||||
# Function to setup PHP 5.6 and newer using Homebrew.
|
# Function to setup PHP 5.6 and newer using Homebrew.
|
||||||
add_php() {
|
add_php() {
|
||||||
action=$1
|
action=$1
|
||||||
@@ -182,6 +187,9 @@ add_php() {
|
|||||||
php_keg="php@$version$suffix"
|
php_keg="php@$version$suffix"
|
||||||
php_formula="shivammathur/php/$php_keg"
|
php_formula="shivammathur/php/$php_keg"
|
||||||
if [[ "$existing_version" = "false" || -n "$suffix" || "$action" = "upgrade" ]]; then
|
if [[ "$existing_version" = "false" || -n "$suffix" || "$action" = "upgrade" ]]; then
|
||||||
|
if [ "${runner:?}" != "self-hosted" ] && [ "${use_package_cache:-true}" != "false" ] && setup_cached_versions; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
update_dependencies
|
update_dependencies
|
||||||
add_brew_tap "$php_tap"
|
add_brew_tap "$php_tap"
|
||||||
fi
|
fi
|
||||||
@@ -252,7 +260,7 @@ setup_php() {
|
|||||||
if [[ "$version" =~ ${old_versions:?} ]]; then
|
if [[ "$version" =~ ${old_versions:?} ]]; then
|
||||||
run_script "php5-darwin" "${version/./}" >/dev/null 2>&1
|
run_script "php5-darwin" "${version/./}" >/dev/null 2>&1
|
||||||
status="Installed"
|
status="Installed"
|
||||||
elif [ "${existing_version:0:3}" != "$version" ]; then
|
elif [[ "${existing_version:0:3}" != "$version" || -n "$(get_php_formula_suffix)" ]]; then
|
||||||
add_php "install" "$existing_version" >/dev/null 2>&1
|
add_php "install" "$existing_version" >/dev/null 2>&1
|
||||||
status="Installed"
|
status="Installed"
|
||||||
elif [[ "${existing_version:0:3}" = "$version" && "${update:?}" = "true" ]]; then
|
elif [[ "${existing_version:0:3}" = "$version" && "${update:?}" = "true" ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user