Skip to content

Commit 7f61475

Browse files
james2doyletaylorotwell
authored andcommitted
fix changes where brew php paths now include @ and semver-style versions in paths (#545)
1 parent be8fb05 commit 7f61475

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

cli/Valet/Brew.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ function linkedPhp()
182182
$resolvedPath = $this->files->readLink('/usr/local/bin/php');
183183

184184
return $this->supportedPhpVersions()->first(function ($version) use ($resolvedPath) {
185-
return strpos($resolvedPath, "/$version/") !== false;
185+
return strpos(preg_replace('/([@|\.])/', '', $resolvedPath, "/$version/")) !== false;
186186
}, function () {
187187
throw new DomainException("Unable to determine linked PHP.");
188188
});

cli/Valet/PhpFpm.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ function fpmConfigPath()
113113
'php56' => '/usr/local/etc/php/5.6/php-fpm.conf',
114114
];
115115

116-
return $confLookup[$this->brew->linkedPhp()];
116+
$key = preg_replace('/([@|\.])/', '', $this->brew->linkedPhp());
117+
118+
return $confLookup[$key];
117119
}
118120
}

0 commit comments

Comments
 (0)