1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-05 08:30:07 +01:00

working on php version and tests

This commit is contained in:
James Barnard
2019-01-19 19:37:44 +00:00
committed by Matt Stauffer
parent 83b1b2c467
commit 28748baa80
5 changed files with 205 additions and 18 deletions

View File

@@ -120,4 +120,33 @@ function fpmConfigPath()
? '/usr/local/etc/php/5.6/php-fpm.conf'
: "/usr/local/etc/php/${versionNormalized}/php-fpm.d/www.conf";
}
function useVersion($version)
{
// Ensure we have php{version}
if (substr($version, 0, 3) !== 'php') {
$version = 'php' . $version;
}
$foundResult = $this->brew->search($version, 'php');
if (!$this->brew->supportedPhpVersions()->contains($version)) {
throw new DomainException(
sprintf('Valet doesn\'t support PHP version: %s', $version)
);
}
if ($this->brew->hasLinkedPhp()) {
$currentVersion = $this->brew->linkedPhp();
info(sprintf('Unlinking current version: %s', $currentVersion));
$this->brew->unlink($currentVersion);
}
$this->brew->ensureInstalled($version);
info(sprintf('Linking new version: %s', $version));
$this->brew->link($version, true);
$this->install();
}
}