ExecutableFinder
in package
Generic executable finder.
Tags
Table of Contents
Constants
- CMD_BUILTINS = ['assoc', 'break', 'call', 'cd', 'chdir', 'cls', 'color', 'copy', 'date', 'del', 'dir', 'echo', 'endlocal', 'erase', 'exit', 'for', 'ftype', 'goto', 'help', 'if', 'label', 'md', 'mkdir', 'mklink', 'move', 'path', 'pause', 'popd', 'prompt', 'pushd', 'rd', 'rem', 'ren', 'rename', 'rmdir', 'set', 'setlocal', 'shift', 'start', 'time', 'title', 'type', 'ver', 'vol']
Properties
- $suffixes : array<string|int, mixed>
Methods
- addSuffix() : void
- Adds new possible suffix to check for executable.
- find() : string|null
- Finds an executable by name.
- setSuffixes() : void
- Replaces default suffixes of executable.
Constants
CMD_BUILTINS
private
mixed
CMD_BUILTINS
= ['assoc', 'break', 'call', 'cd', 'chdir', 'cls', 'color', 'copy', 'date', 'del', 'dir', 'echo', 'endlocal', 'erase', 'exit', 'for', 'ftype', 'goto', 'help', 'if', 'label', 'md', 'mkdir', 'mklink', 'move', 'path', 'pause', 'popd', 'prompt', 'pushd', 'rd', 'rem', 'ren', 'rename', 'rmdir', 'set', 'setlocal', 'shift', 'start', 'time', 'title', 'type', 'ver', 'vol']
Properties
$suffixes
private
array<string|int, mixed>
$suffixes
= []
Methods
addSuffix()
Adds new possible suffix to check for executable.
public
addSuffix(string $suffix) : void
Parameters
- $suffix : string
find()
Finds an executable by name.
public
find(string $name[, string|null $default = null ][, array<string|int, mixed> $extraDirs = [] ]) : string|null
Parameters
- $name : string
-
The executable name (without the extension)
- $default : string|null = null
-
The default to return if no executable is found
- $extraDirs : array<string|int, mixed> = []
-
Additional dirs to check into
Return values
string|nullsetSuffixes()
Replaces default suffixes of executable.
public
setSuffixes(array<string|int, mixed> $suffixes) : void
Parameters
- $suffixes : array<string|int, mixed>