update patch 1
This commit is contained in:
+5
-3
@@ -38,7 +38,10 @@ class ExecutableFinder
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds new possible suffix to check for executable.
|
||||
* Adds new possible suffix to check for executable, including the dot (.).
|
||||
*
|
||||
* $finder = new ExecutableFinder();
|
||||
* $finder->addSuffix('.foo');
|
||||
*/
|
||||
public function addSuffix(string $suffix): void
|
||||
{
|
||||
@@ -64,10 +67,9 @@ class ExecutableFinder
|
||||
$extraDirs
|
||||
);
|
||||
|
||||
$suffixes = [];
|
||||
$suffixes = $this->suffixes;
|
||||
if ('\\' === \DIRECTORY_SEPARATOR) {
|
||||
$pathExt = getenv('PATHEXT');
|
||||
$suffixes = $this->suffixes;
|
||||
$suffixes = array_merge($suffixes, $pathExt ? explode(\PATH_SEPARATOR, $pathExt) : ['.exe', '.bat', '.cmd', '.com']);
|
||||
}
|
||||
$suffixes = '' !== pathinfo($name, PATHINFO_EXTENSION) ? array_merge([''], $suffixes) : array_merge($suffixes, ['']);
|
||||
|
||||
Reference in New Issue
Block a user