27 return array_unique( array_merge(
28 [
'/usr/bin',
'/bin',
'/usr/local/bin',
'/opt/csw/bin',
29 '/usr/gnu/bin',
'/usr/sfw/bin',
'/sw/bin',
'/opt/local/bin' ],
30 explode( PATH_SEPARATOR, getenv(
'PATH' ) )
52 $command =
$path . DIRECTORY_SEPARATOR . $name;
55 $file_exists = @is_executable( $command );
58 if ( !$versionInfo ) {
62 $output = Shell::command( $command, $versionInfo[0] )
63 ->includeStderr()->execute()->getStdout();
64 if ( str_contains( $output, $versionInfo[1] ) ) {
91 foreach ( (array)$names as $name ) {
92 foreach ( $paths as
$path ) {
94 if ( $exe !==
false ) {
106class_alias( ExecutableFinder::class,
'ExecutableFinder' );