MediaWiki master
|
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. | |
Static Protected Member Functions | |
static | findExecutable ( $path, $name, $versionInfo=false) |
Search a path for any of the given executable names. | |
static | getPossibleBinPaths () |
Get an array of likely places we can find executables. | |
Utility class to find executables in likely places.
Definition at line 29 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 63 of file ExecutableFinder.php.
References $path.
|
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 97 of file ExecutableFinder.php.
References $path.
Referenced by MediaWiki\Installer\Installer\envCheckDiff3(), MediaWiki\Installer\Installer\envCheckGit(), and MediaWiki\Installer\Installer\envCheckGraphics().
|
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 38 of file ExecutableFinder.php.