mirror of
https://github.com/laravel/valet.git
synced 2026-02-04 16:10:08 +01:00
wip
This commit is contained in:
@@ -309,6 +309,7 @@ function ($version) use ($resolvedPhpVersion) {
|
|||||||
public function getPhpBinaryPath($phpVersion)
|
public function getPhpBinaryPath($phpVersion)
|
||||||
{
|
{
|
||||||
$versionInteger = preg_replace('~[^\d]~', '', $phpVersion);
|
$versionInteger = preg_replace('~[^\d]~', '', $phpVersion);
|
||||||
|
$binPath = null;
|
||||||
|
|
||||||
if (file_exists(BREW_PREFIX . "/bin/valetphp{$versionInteger}")) {
|
if (file_exists(BREW_PREFIX . "/bin/valetphp{$versionInteger}")) {
|
||||||
return 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;
|
$path = !empty($details[0]->linked_keg) ? $details[0]->linked_keg : $details[0]->installed[0]->version;
|
||||||
|
|
||||||
if (file_exists(trim($cellar).'/'.$path.'/bin/php')) {
|
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")) {
|
// if (!$binPath && file_exists(BREW_PREFIX . "/opt/$phpVersion/bin/php")) {
|
||||||
return 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";
|
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.
|
* Restart the linked PHP-FPM Homebrew service.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -221,7 +221,6 @@ public function isolateDirectory($directory, $version)
|
|||||||
$this->createConfigurationFiles($version);
|
$this->createConfigurationFiles($version);
|
||||||
|
|
||||||
$this->site->isolate($site, $version);
|
$this->site->isolate($site, $version);
|
||||||
$this->brew->symlinkPhpBinary($version);
|
|
||||||
|
|
||||||
$this->stopIfUnused($oldCustomPhpVersion);
|
$this->stopIfUnused($oldCustomPhpVersion);
|
||||||
$this->restart($version);
|
$this->restart($version);
|
||||||
|
|||||||
Reference in New Issue
Block a user