Skip to content

Commit ba746e3

Browse files
authored
Merge pull request #392 from KorvinSzanto/patch-1
Add support for the PHP72 package
2 parents 4e4c32d + 0ed3eea commit ba746e3

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

cli/Valet/Brew.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -171,15 +171,15 @@ function linkedPhp()
171171

172172
$resolvedPath = $this->files->readLink('/usr/local/bin/php');
173173

174-
if (strpos($resolvedPath, 'php71') !== false) {
175-
return 'php71';
176-
} elseif (strpos($resolvedPath, 'php70') !== false) {
177-
return 'php70';
178-
} elseif (strpos($resolvedPath, 'php56') !== false) {
179-
return 'php56';
180-
} else {
181-
throw new DomainException("Unable to determine linked PHP.");
174+
// Check all currently supported PHP versions
175+
$phpVersions = ['php72', 'php71', 'php70', 'php56'];
176+
foreach ($phpVersions as $version) {
177+
if (strpos($resolvedPath, $version) !== false) {
178+
return $version;
179+
}
182180
}
181+
182+
throw new DomainException("Unable to determine linked PHP.");
183183
}
184184

185185
/**

cli/Valet/PhpFpm.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ function restart()
9595
*/
9696
function stop()
9797
{
98-
$this->brew->stopService('php56', 'php70', 'php71');
98+
$this->brew->stopService('php56', 'php70', 'php71', 'php72');
9999
}
100100

101101
/**
@@ -106,6 +106,7 @@ function stop()
106106
function fpmConfigPath()
107107
{
108108
$confLookup = [
109+
'php72' => '/usr/local/etc/php/7.2/php-fpm.d/www.conf',
109110
'php71' => '/usr/local/etc/php/7.1/php-fpm.d/www.conf',
110111
'php70' => '/usr/local/etc/php/7.0/php-fpm.d/www.conf',
111112
'php56' => '/usr/local/etc/php/5.6/php-fpm.conf',

0 commit comments

Comments
 (0)