mirror of
https://github.com/laravel/valet.git
synced 2026-02-05 08:30:07 +01:00
wip - refactor with valetphprc version (#10)
This commit is contained in:
committed by
GitHub
parent
0202f7773a
commit
d198d7739c
@@ -3,6 +3,7 @@
|
||||
namespace Valet;
|
||||
|
||||
use DomainException;
|
||||
use PhpFpm;
|
||||
|
||||
class Site
|
||||
{
|
||||
@@ -1108,4 +1109,21 @@ public function replaceSockFile($siteConf, $phpVersion)
|
||||
|
||||
return '# '.ISOLATED_PHP_VERSION.'='.$phpVersion.PHP_EOL.$siteConf;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get PHP version from .valetphprc for a site.
|
||||
*
|
||||
* @param string $site
|
||||
* @return string|null
|
||||
*/
|
||||
public function phpRcVersion($site)
|
||||
{
|
||||
if ($site = $this->parked()->merge($this->links())->where('site', $site)->first()) {
|
||||
$path = data_get($site, 'path').'/.valetphprc';
|
||||
|
||||
if ($this->files->exists($path)) {
|
||||
return PhpFpm::normalizePhpVersion(trim($this->files->get($path)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user