1
0
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:
Nasir Uddin Nobin
2022-03-30 03:48:03 +06:00
committed by GitHub
parent 0202f7773a
commit d198d7739c
4 changed files with 81 additions and 11 deletions

View File

@@ -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)));
}
}
}
}