mirror of
https://github.com/laravel/valet.git
synced 2026-02-05 08:30:07 +01:00
wip
This commit is contained in:
@@ -298,6 +298,32 @@ function ($version) use ($resolvedPhpVersion) {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get PHP binary path for a given version
|
||||
*
|
||||
* @param string $phpVersion
|
||||
*
|
||||
* @return string|bool
|
||||
*/
|
||||
public function getPhpBinaryPath($phpVersion)
|
||||
{
|
||||
if (file_exists(BREW_PREFIX . "/opt/$phpVersion/bin/php")) {
|
||||
return BREW_PREFIX . "/opt/$phpVersion/bin/php";
|
||||
}
|
||||
|
||||
$cellar = $this->cli->runAsUser("brew --cellar $phpVersion");
|
||||
$details = json_decode($this->cli->runAsUser("brew info --json $phpVersion"));
|
||||
|
||||
$path = !empty($details[0]->linked_keg) ? $details[0]->linked_keg : $details[0]->installed[0]->version;
|
||||
|
||||
if (file_exists(trim($cellar).'/'.$path.'/bin/php')) {
|
||||
return trim($cellar).'/'.$path.'/bin/php';
|
||||
}
|
||||
|
||||
return "php";
|
||||
}
|
||||
|
||||
/**
|
||||
* Restart the linked PHP-FPM Homebrew service.
|
||||
*
|
||||
|
||||
@@ -555,10 +555,16 @@
|
||||
/**
|
||||
* List isolated sites.
|
||||
*/
|
||||
$app->command('isolated [--site=]', function ($site) {
|
||||
$app->command('isolated [--site=] [--binary]', function ($site, $binary) {
|
||||
if ($site) {
|
||||
if ($phpVersion = Site::customPhpVersion($site.'.'.data_get(Configuration::read(), 'tld'))) {
|
||||
|
||||
$phpVersion = PhpFpm::normalizePhpVersion($phpVersion);
|
||||
|
||||
if($binary){
|
||||
return output(Brew::getPhpBinaryPath($phpVersion));
|
||||
}
|
||||
|
||||
return output($phpVersion);
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user