Resolve PHP formula aliases before invoking Homebrew

This commit is contained in:
Shivam Mathur committed 2026-10-08 13:02:36 +05:30
1 parent 57747c1c10
commit 7d671baa10
1 file changed
+7 -1
+7 -1
View File
@@ -199,7 +199,7 @@ setup_cached_versions() {
# Function to setup PHP 5.6 and newer using Homebrew.
add_php() {
local exit_code
local exit_code php_alias
action=$1
existing_version=$2
suffix="$(get_php_formula_suffix)"
@@ -213,6 +213,12 @@ add_php() {
update_dependencies
add_brew_tap "$php_tap"
fi
# Resolve PHP aliases before invoking brew to avoid scanning unrelated installed formulae.
php_alias="$tap_dir/$php_tap/Aliases/$php_keg"
if [ -L "$php_alias" ]; then
php_keg="$(basename "$(readlink "$php_alias")" .rb)"
php_formula="shivammathur/php/$php_keg"
fi
if [[ "$existing_version" != "false" && -z "$suffix" ]]; then
if [ "$action" = "upgrade" ]; then
safe_brew install --only-dependencies "$php_formula" || return $?