mirror of
https://github.com/laravel/valet.git
synced 2026-02-04 08:10:07 +01:00
wip
This commit is contained in:
@@ -309,6 +309,7 @@ function ($version) use ($resolvedPhpVersion) {
|
||||
public function getPhpBinaryPath($phpVersion)
|
||||
{
|
||||
$versionInteger = preg_replace('~[^\d]~', '', $phpVersion);
|
||||
$binPath = null;
|
||||
|
||||
if (file_exists(BREW_PREFIX . "/bin/valetphp{$versionInteger}")) {
|
||||
return BREW_PREFIX . "/bin/valetphp{$versionInteger}";
|
||||
@@ -320,30 +321,21 @@ public function getPhpBinaryPath($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';
|
||||
$binPath = trim($cellar).'/'.$path.'/bin/php';
|
||||
}
|
||||
|
||||
if (file_exists(BREW_PREFIX . "/opt/$phpVersion/bin/php")) {
|
||||
return BREW_PREFIX . "/opt/$phpVersion/bin/php";
|
||||
// if (!$binPath && file_exists(BREW_PREFIX . "/opt/$phpVersion/bin/php")) {
|
||||
// return BREW_PREFIX . "/opt/$phpVersion/bin/php";
|
||||
// }
|
||||
|
||||
if($binPath){
|
||||
$this->files->symlinkAsUser($binPath, BREW_PREFIX . "/bin/valetphp{$versionInteger}");
|
||||
return $binPath;
|
||||
}
|
||||
|
||||
return "php";
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a PHP binary symlink for a PHP version
|
||||
*
|
||||
* @param string $phpVersion
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function symlinkPhpBinary($phpVersion)
|
||||
{
|
||||
$versionInteger = preg_replace('~[^\d]~', '', $phpVersion);
|
||||
|
||||
$this->files->symlinkAsUser($this->getPhpBinaryPath($phpVersion), BREW_PREFIX . "/bin/valetphp{$versionInteger}");
|
||||
}
|
||||
|
||||
/**
|
||||
* Restart the linked PHP-FPM Homebrew service.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user