mirror of
https://github.com/laravel/valet.git
synced 2026-02-07 09:10:03 +01:00
Merge pull request #1360 from joelbutcher/add-php-isolation-from-link-command
Add php isolation from link command
This commit is contained in:
19
cli/app.php
19
cli/app.php
@@ -175,15 +175,26 @@ function (ConsoleCommandEvent $event) {
|
||||
/**
|
||||
* Register a symbolic link with Valet.
|
||||
*/
|
||||
$app->command('link [name] [--secure]', function (OutputInterface $output, $name, $secure) {
|
||||
$app->command('link [name] [--secure] [--isolate]', function (OutputInterface $output, $name, $secure, $isolate) {
|
||||
$linkPath = Site::link(getcwd(), $name = $name ?: basename(getcwd()));
|
||||
|
||||
info('A ['.$name.'] symbolic link has been created in ['.$linkPath.'].');
|
||||
|
||||
if ($secure) {
|
||||
$this->runCommand('secure '.$name);
|
||||
$this->runCommand('secure');
|
||||
}
|
||||
})->descriptions('Link the current working directory to Valet');
|
||||
|
||||
if ($isolate) {
|
||||
if (Site::phpRcVersion($name)) {
|
||||
$this->runCommand('isolate');
|
||||
} else {
|
||||
warning('Valet could not determine which PHP version to use for this site.');
|
||||
}
|
||||
}
|
||||
})->descriptions('Link the current working directory to Valet', [
|
||||
'--secure' => 'Link the site with a trusted TLS certificate.',
|
||||
'--isolate' => 'Isolate the site to the PHP version specified in the current working directory\'s .valetphprc file.',
|
||||
]);
|
||||
|
||||
/**
|
||||
* Display all of the registered symbolic links.
|
||||
@@ -561,7 +572,7 @@ function (ConsoleCommandEvent $event) {
|
||||
|
||||
PhpFpm::useVersion($phpVersion, $force);
|
||||
})->descriptions('Change the version of PHP used by Valet', [
|
||||
'phpVersion' => 'The PHP version you want to use, e.g php@7.3',
|
||||
'phpVersion' => 'The PHP version you want to use, e.g php@8.1',
|
||||
]);
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user