mirror of
https://github.com/laravel/valet.git
synced 2026-02-04 16:10:08 +01:00
Catch up to #1370
This commit is contained in:
@@ -690,19 +690,21 @@ function (ConsoleCommandEvent $event) {
|
||||
/**
|
||||
* Proxy commands through to an isolated site's version of PHP.
|
||||
*/
|
||||
$app->command('php [command]', function (OutputInterface $output, $command) {
|
||||
$app->command('php [--site=] [command]', function (OutputInterface $output, $command) {
|
||||
warning('It looks like you are running `cli/valet.php` directly; please use the `valet` script in the project root instead.');
|
||||
})->descriptions("Proxy PHP commands with isolated site's PHP executable", [
|
||||
'command' => "Command to run with isolated site's PHP executable",
|
||||
'--site' => 'Specify the site to use to get the PHP version (e.g. if the site isn\'t linked as its directory name)',
|
||||
]);
|
||||
|
||||
/**
|
||||
* Proxy commands through to an isolated site's version of Composer.
|
||||
*/
|
||||
$app->command('composer [command]', function (OutputInterface $output, $command) {
|
||||
$app->command('composer [--site=] [command]', function (OutputInterface $output, $command) {
|
||||
warning('It looks like you are running `cli/valet.php` directly; please use the `valet` script in the project root instead.');
|
||||
})->descriptions("Proxy Composer commands with isolated site's PHP executable", [
|
||||
'command' => "Composer command to run with isolated site's PHP executable",
|
||||
'--site' => 'Specify the site to use to get the PHP version (e.g. if the site isn\'t linked as its directory name)',
|
||||
]);
|
||||
|
||||
/**
|
||||
|
||||
14
valet
14
valet
@@ -143,14 +143,24 @@ then
|
||||
# Proxy PHP commands to the "php" executable on the isolated site
|
||||
elif [[ "$1" = "php" ]]
|
||||
then
|
||||
$($PHP "$DIR/cli/valet.php" which-php) "${@:2}"
|
||||
if [[ $2 == *"--site="* ]]; then
|
||||
SITE=${2#*=}
|
||||
$(php "$DIR/cli/valet.php" which-php $SITE) "${@:3}"
|
||||
else
|
||||
$(php "$DIR/cli/valet.php" which-php) "${@:2}"
|
||||
fi
|
||||
|
||||
exit
|
||||
|
||||
# Proxy Composer commands with the "php" executable on the isolated site
|
||||
elif [[ "$1" = "composer" ]]
|
||||
then
|
||||
$($PHP "$DIR/cli/valet.php" which-php) $(which composer) "${@:2}"
|
||||
if [[ $2 == *"--site="* ]]; then
|
||||
SITE=${2#*=}
|
||||
$(php "$DIR/cli/valet.php" which-php $SITE) $(which composer) "${@:3}"
|
||||
else
|
||||
$(php "$DIR/cli/valet.php" which-php) $(which composer) "${@:2}"
|
||||
fi
|
||||
|
||||
exit
|
||||
|
||||
|
||||
Reference in New Issue
Block a user