Add relative path support for PHP_BINARY env var of PhpExecutableFinder

This commit is contained in:
Dany Maillard 2018-08-29 01:20:27 +02:00
parent da0ef24744
commit 52ed9889af

View File

@ -37,7 +37,14 @@ class PhpExecutableFinder
{
if ($php = getenv('PHP_BINARY')) {
if (!is_executable($php)) {
return false;
$command = '\\' === \DIRECTORY_SEPARATOR ? 'where' : 'command -v';
if ($php = strtok(exec($command.' '.escapeshellarg($php)), PHP_EOL)) {
if (!is_executable($php)) {
return false;
}
} else {
return false;
}
}
return $php;