protected function findWhere($command, $noticeOnError = true)
    {
        static $result;
        if (!isset($result[$command])) {
            if (is_executable($command)) {
                $result[$command] = $command;
            } else {
                $args = ['command', '-v', $command];
                if (OsUtil::isWindows()) {
                    $args = ['where', $command];
                }
                $result[$command] = $this->execute($args, null, false, true);
                if ($result[$command] === false && $noticeOnError) {
                    trigger_error(sprintf("Failed to find command via: %s", implode(' ', $args)), E_USER_NOTICE);
                }
            }
        }

        return $result[$command];
    }
protected function findWhere($command, $noticeOnError = true)
    {
        static $result;
        if (!isset($result[$command])) {
            if (is_executable($command)) {
                $result[$command] = $command;
            } else {
                $args = ['command', '-v', $command];
                if (OsUtil::isWindows()) {
                    $args = ['where', $command];
                }
                $result[$command] = $this->execute($args, null, false, true);
                if ($result[$command] === false && $noticeOnError) {
                    trigger_error(sprintf("Failed to find command via: %s", implode(' ', $args)), E_USER_NOTICE);
                }
            }
        }

        return $result[$command];
    }
protected function findWhere ( $ command , $ noticeOnError = true ) { static $ result ; if ( ! isset ( $ result [ $ command ] ) ) { if ( is_executable ( $ command ) ) { $ result [ $ command ] = $ command ; } else { $ args = [ 'command' , '-v' , $ command ] ; if ( OsUtil :: isWindows ( ) ) { $ args = [ 'where' , $ command ] ; } $ result [ $ command ] = $ this -> execute ( $ args , null , false , true ) ; if ( $ result [ $ command ] === false && $ noticeOnError ) { trigger_error ( sprintf ( "Failed to find command via: %s" , implode ( ' ' , $ args ) ) , E_USER_NOTICE ) ; } } } return $ result [ $ command ] ; }
Run 'where' or equivalent on a command.

@param string $command
@param bool $noticeOnError

@return string|bool
A list of command paths (one per line) or false on failure.
Run where or equivalent on a command .