[Process] Clean-up/simplify code
This commit is contained in:
parent
56f473a073
commit
28e1313e5d
@ -71,7 +71,11 @@ class ExecutableFinder
|
||||
);
|
||||
}
|
||||
|
||||
$suffixes = DIRECTORY_SEPARATOR == '\\' ? (getenv('PATHEXT') ? explode(PATH_SEPARATOR, getenv('PATHEXT')) : $this->suffixes) : array('');
|
||||
$suffixes = array('');
|
||||
if (defined('PHP_WINDOWS_VERSION_BUILD')) {
|
||||
$pathExt = getenv('PATHEXT');
|
||||
$suffixes = $pathExt ? explode(PATH_SEPARATOR, $pathExt) : $this->suffixes;
|
||||
}
|
||||
foreach ($suffixes as $suffix) {
|
||||
foreach ($dirs as $dir) {
|
||||
if (is_file($file = $dir.DIRECTORY_SEPARATOR.$name.$suffix) && (self::$isWindows || is_executable($file))) {
|
||||
|
@ -46,19 +46,14 @@ class PhpExecutableFinder
|
||||
return $php;
|
||||
}
|
||||
|
||||
$suffixes = DIRECTORY_SEPARATOR == '\\' ? (getenv('PATHEXT') ? explode(PATH_SEPARATOR, getenv('PATHEXT')) : array('.exe', '.bat', '.cmd', '.com')) : array('');
|
||||
foreach ($suffixes as $suffix) {
|
||||
if (is_executable($php = PHP_BINDIR.DIRECTORY_SEPARATOR.'php'.$suffix)) {
|
||||
return $php;
|
||||
}
|
||||
}
|
||||
|
||||
if ($php = getenv('PHP_PEAR_PHP_BIN')) {
|
||||
if (is_executable($php)) {
|
||||
return $php;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->executableFinder->find('php');
|
||||
$dirs = array(PHP_BINDIR);
|
||||
|
||||
return $this->executableFinder->find('php', false, $dirs);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user