1
0
mirror of https://github.com/danog/parallel.git synced 2024-11-30 04:39:01 +01:00
This commit is contained in:
Syed Irfaq R. ⚡️ 2018-01-23 03:45:09 +05:30 committed by Aaron Piotrowski
parent abaa1609fd
commit d2b9c03318

View File

@ -107,7 +107,12 @@ class Process implements Context {
private static function locateBinary(): string {
$executable = \strncasecmp(\PHP_OS, "WIN", 3) === 0 ? "php.exe" : "php";
foreach (\explode(\PATH_SEPARATOR, \getenv("PATH")) as $path) {
$paths = \array_filter(\explode(\PATH_SEPARATOR, \getenv("PATH")));
$paths[] = \PHP_BINDIR;
$paths = \array_unique($paths);
foreach ($paths as $path) {
$path .= \DIRECTORY_SEPARATOR . $executable;
if (\is_executable($path)) {
return self::$binaryPath = $path;