MediaWiki
1.34.0
|
Utility class to find executables in likely places. More...
Static Public Member Functions | |
static | findInDefaultPaths ( $names, $versionInfo=false) |
Same as locateExecutable(), but checks in getPossibleBinPaths() by default. More... | |
Static Protected Member Functions | |
static | findExecutable ( $path, $name, $versionInfo=false) |
Search a path for any of the given executable names. More... | |
static | getPossibleBinPaths () |
Get an array of likely places we can find executables. More... | |
Utility class to find executables in likely places.
Definition at line 28 of file ExecutableFinder.php.
|
staticprotected |
Search a path for any of the given executable names.
Returns the executable name if found. Also checks the version string returned by each executable.
Used only by environment checks.
string | $path | Path to search |
string | $name | Executable name to look for |
array | bool | $versionInfo | False or array with two members: 0 => Parameter to pass to binary for version check (e.g. –version) 1 => String to compare the output with |
If $versionInfo is not false, only executables with a version matching $versionInfo[1] will be returned.
Definition at line 62 of file ExecutableFinder.php.
References $command, $output, and $path.
Referenced by findInDefaultPaths().
|
static |
Same as locateExecutable(), but checks in getPossibleBinPaths() by default.
string | string[] | $names | Array of possible names. |
array | bool | $versionInfo | Default: false or array with two members: 0 => Parameter to run for version check, e.g. '–version' 1 => String to compare the output with |
If $versionInfo is not false, only executables with a version matching $versionInfo[1] will be returned.
Definition at line 96 of file ExecutableFinder.php.
References $path, findExecutable(), and getPossibleBinPaths().
Referenced by Installer\envCheckDiff3(), Installer\envCheckGit(), Installer\envCheckGraphics(), MediaWiki\Shell\CommandFactory\findFirejail(), and Maintenance\readlineEmulation().
|
staticprotected |
Get an array of likely places we can find executables.
Check a bunch of known Unix-like defaults, as well as the PATH environment variable (which should maybe make it work for Windows?)
Definition at line 37 of file ExecutableFinder.php.
Referenced by findInDefaultPaths().