mirror of
https://github.com/laravel/valet.git
synced 2026-02-04 16:10:08 +01:00
add normalizePhpVersion inside getPhpExecutablePath
This commit is contained in:
@@ -298,6 +298,8 @@ public function getPhpExecutablePath($phpVersion = null)
|
||||
return BREW_PREFIX.'/bin/php';
|
||||
}
|
||||
|
||||
$phpVersion = PhpFpm::normalizePhpVersion($phpVersion);
|
||||
|
||||
// Check the default `/opt/homebrew/opt/php@8.1/bin/php` location first
|
||||
if ($this->files->exists(BREW_PREFIX."/opt/{$phpVersion}/bin/php")) {
|
||||
return BREW_PREFIX."/opt/{$phpVersion}/bin/php";
|
||||
|
||||
@@ -322,7 +322,7 @@ public function symlinkPrimaryValetSock($phpVersion)
|
||||
/**
|
||||
* If passed php7.4, or php74, 7.4, or 74 formats, normalize to php@7.4 format.
|
||||
*/
|
||||
public function normalizePhpVersion($version)
|
||||
public static function normalizePhpVersion($version)
|
||||
{
|
||||
return preg_replace('/(?:php@?)?([0-9+])(?:.)?([0-9+])/i', 'php@$1.$2', $version);
|
||||
}
|
||||
|
||||
@@ -575,8 +575,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
$phpVersion = $phpVersion ? PhpFpm::normalizePhpVersion($phpVersion) : null;
|
||||
|
||||
return output(Brew::getPhpExecutablePath($phpVersion));
|
||||
})->descriptions('Get the PHP executable path for a given site', [
|
||||
'site' => 'The site to get the PHP executable path for',
|
||||
|
||||
Reference in New Issue
Block a user