1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-04 16:10:08 +01:00

fix(entry-script): use correct php binary for proxy commands

These are the only instances, where the valet cli script is executed with the default
php binary instead of the evaluated binary.

We now use the `$PHP` executable to ensure that the valet cli is always called with the correct binary even when proxying composer / php.
This commit is contained in:
Saibotk
2024-12-18 23:01:36 +01:00
parent ff4b7675c4
commit 85a8c89902

8
valet
View File

@@ -140,9 +140,9 @@ elif [[ "$1" = "php" ]]
then then
if [[ $2 == *"--site="* ]]; then if [[ $2 == *"--site="* ]]; then
SITE=${2#*=} SITE=${2#*=}
$(php "$DIR/cli/valet.php" which-php $SITE) "${@:3}" $("$PHP" "$DIR/cli/valet.php" which-php $SITE) "${@:3}"
else else
$(php "$DIR/cli/valet.php" which-php) "${@:2}" $("$PHP" "$DIR/cli/valet.php" which-php) "${@:2}"
fi fi
exit exit
@@ -152,9 +152,9 @@ elif [[ "$1" = "composer" ]]
then then
if [[ $2 == *"--site="* ]]; then if [[ $2 == *"--site="* ]]; then
SITE=${2#*=} SITE=${2#*=}
$(php "$DIR/cli/valet.php" which-php $SITE) $(which composer) "${@:3}" $("$PHP" "$DIR/cli/valet.php" which-php $SITE) $(which composer) "${@:3}"
else else
$(php "$DIR/cli/valet.php" which-php) $(which composer) "${@:2}" $("$PHP" "$DIR/cli/valet.php" which-php) $(which composer) "${@:2}"
fi fi
exit exit