mirror of
https://github.com/danog/parallel.git
synced 2024-11-30 04:39:01 +01:00
parent
abaa1609fd
commit
d2b9c03318
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user