public function setHost($host)
    {
        $this->host = $host;
        if (strpos($host, '/') !== false || strpos($host, '?') !== false) {
            if (strpos($host, 'http') === false) {
                $host = 'https://' . $host;
            }
            $url = parse_url($host);
            $this->host = $url['host'];

            if (isset($url['path'])) {
                $this->setPath($url['path']);
            }

            if (isset($url['query'])) {
                if (!isset($url['path'])) { // for example.org?query=string
                    $this->setPath('/');
                }
                $this->setQuery($url['query']);
            }
        }

        return $this;
    }
public function setHost($host)
    {
        $this->host = $host;
        if (strpos($host, '/') !== false || strpos($host, '?') !== false) {
            if (strpos($host, 'http') === false) {
                $host = 'https://' . $host;
            }
            $url = parse_url($host);
            $this->host = $url['host'];

            if (isset($url['path'])) {
                $this->setPath($url['path']);
            }

            if (isset($url['query'])) {
                if (!isset($url['path'])) { // for example.org?query=string
                    $this->setPath('/');
                }
                $this->setQuery($url['query']);
            }
        }

        return $this;
    }
public function setHost ( $ host ) { $ this -> host = $ host ; if ( strpos ( $ host , '/' ) !== false || strpos ( $ host , '?' ) !== false ) { if ( strpos ( $ host , 'http' ) === false ) { $ host = 'https://' . $ host ; } $ url = parse_url ( $ host ) ; $ this -> host = $ url [ 'host' ] ; if ( isset ( $ url [ 'path' ] ) ) { $ this -> setPath ( $ url [ 'path' ] ) ; } if ( isset ( $ url [ 'query' ] ) ) { if ( ! isset ( $ url [ 'path' ] ) ) { // for example.org?query=string $ this -> setPath ( '/' ) ; } $ this -> setQuery ( $ url [ 'query' ] ) ; } } return $ this ; }
Set request host

@param mixed $host
@return Authentication
Set request host