public function findConfiguredHost($host)
    {
        list($user, $host) = $this->parseHost($host);

        foreach ($this->groups as $group) {
            if ((isset($group['host']) && $group['host'] == $host) ||
                (isset($group['hostname']) && $group['hostname'] == $host)) {
                if (! empty($user)) {
                    // User is not specified in the SSH configuration...
                    if (! isset($group['user'])) {
                        continue;
                    }

                    // User is specified in the SSH configuration but is not the given user....
                    if (isset($group['user']) && $group['user'] != $user) {
                        continue;
                    }
                }

                return $group['host'];
            }
        }
    }
public function findConfiguredHost($host)
    {
        list($user, $host) = $this->parseHost($host);

        foreach ($this->groups as $group) {
            if ((isset($group['host']) && $group['host'] == $host) ||
                (isset($group['hostname']) && $group['hostname'] == $host)) {
                if (! empty($user)) {
                    // User is not specified in the SSH configuration...
                    if (! isset($group['user'])) {
                        continue;
                    }

                    // User is specified in the SSH configuration but is not the given user....
                    if (isset($group['user']) && $group['user'] != $user) {
                        continue;
                    }
                }

                return $group['host'];
            }
        }
    }
public function findConfiguredHost ( $ host ) { list ( $ user , $ host ) = $ this -> parseHost ( $ host ) ; foreach ( $ this -> groups as $ group ) { if ( ( isset ( $ group [ 'host' ] ) && $ group [ 'host' ] == $ host ) || ( isset ( $ group [ 'hostname' ] ) && $ group [ 'hostname' ] == $ host ) ) { if ( ! empty ( $ user ) ) { // User is not specified in the SSH configuration... if ( ! isset ( $ group [ 'user' ] ) ) { continue ; } // User is specified in the SSH configuration but is not the given user.... if ( isset ( $ group [ 'user' ] ) && $ group [ 'user' ] != $ user ) { continue ; } } return $ group [ 'host' ] ; } } }
Get the configured SSH host by name or IP.

@param  string  $host
@return string|null
Get the configured SSH host by name or IP .