src/Autodiscover.php
public function trySubdomainUnauthenticatedGet()
    {
        $this->reset();
        $url = 'http://autodiscover.' . $this->tld . self::AUTODISCOVER_PATH;
        $ch = curl_init();
        $opts = array(
            CURLOPT_URL                 => $url,
            CURLOPT_HTTPGET             => true,
            CURLOPT_RETURNTRANSFER      => true,
            CURLOPT_TIMEOUT             => 4,
            CURLOPT_CONNECTTIMEOUT      => $this->connection_timeout,
            CURLOPT_FOLLOWLOCATION      => false,
            CURLOPT_HEADER              => false,
            CURLOPT_HEADERFUNCTION      => array($this, 'readHeaders'),
            CURLOPT_HTTP200ALIASES      => array(301, 302),
            CURLOPT_IPRESOLVE           => CURL_IPRESOLVE_V4
        );
        curl_setopt_array($ch, $opts);
        $this->last_response    = curl_exec($ch);
        $this->last_info        = curl_getinfo($ch);
        $this->last_curl_errno  = curl_errno($ch);
        $this->last_curl_error  = curl_error($ch);

        if ($this->last_info['http_code'] == 302
            || $this->last_info['http_code'] == 301) {
            if ($this->tryViaUrl($this->last_response_headers['location'])) {
                return self::AUTODISCOVERED_VIA_UNAUTHENTICATED_GET;
            }
        }

        return false;
    }
public function trySubdomainUnauthenticatedGet()
    {
        $this->reset();
        $url = 'http://autodiscover.' . $this->tld . self::AUTODISCOVER_PATH;
        $ch = curl_init();
        $opts = array(
            CURLOPT_URL                 => $url,
            CURLOPT_HTTPGET             => true,
            CURLOPT_RETURNTRANSFER      => true,
            CURLOPT_TIMEOUT             => 4,
            CURLOPT_CONNECTTIMEOUT      => $this->connection_timeout,
            CURLOPT_FOLLOWLOCATION      => false,
            CURLOPT_HEADER              => false,
            CURLOPT_HEADERFUNCTION      => array($this, 'readHeaders'),
            CURLOPT_HTTP200ALIASES      => array(301, 302),
            CURLOPT_IPRESOLVE           => CURL_IPRESOLVE_V4
        );
        curl_setopt_array($ch, $opts);
        $this->last_response    = curl_exec($ch);
        $this->last_info        = curl_getinfo($ch);
        $this->last_curl_errno  = curl_errno($ch);
        $this->last_curl_error  = curl_error($ch);

        if ($this->last_info['http_code'] == 302
            || $this->last_info['http_code'] == 301) {
            if ($this->tryViaUrl($this->last_response_headers['location'])) {
                return self::AUTODISCOVERED_VIA_UNAUTHENTICATED_GET;
            }
        }

        return false;
    }
public function trySubdomainUnauthenticatedGet ( ) { $ this -> reset ( ) ; $ url = 'http://autodiscover.' . $ this -> tld . self :: AUTODISCOVER_PATH ; $ ch = curl_init ( ) ; $ opts = array ( CURLOPT_URL => $ url , CURLOPT_HTTPGET => true , CURLOPT_RETURNTRANSFER => true , CURLOPT_TIMEOUT => 4 , CURLOPT_CONNECTTIMEOUT => $ this -> connection_timeout , CURLOPT_FOLLOWLOCATION => false , CURLOPT_HEADER => false , CURLOPT_HEADERFUNCTION => array ( $ this , 'readHeaders' ) , CURLOPT_HTTP200ALIASES => array ( 301 , 302 ) , CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4 ) ; curl_setopt_array ( $ ch , $ opts ) ; $ this -> last_response = curl_exec ( $ ch ) ; $ this -> last_info = curl_getinfo ( $ ch ) ; $ this -> last_curl_errno = curl_errno ( $ ch ) ; $ this -> last_curl_error = curl_error ( $ ch ) ; if ( $ this -> last_info [ 'http_code' ] == 302 || $ this -> last_info [ 'http_code' ] == 301 ) { if ( $ this -> tryViaUrl ( $ this -> last_response_headers [ 'location' ] ) ) { return self :: AUTODISCOVERED_VIA_UNAUTHENTICATED_GET ; } } return false ; }
Perform an unauthenticated HTTP GET in an attempt to get redirected
via 302 to the correct location to perform the HTTPS POST.

@return integer|boolean
One of the AUTODISCOVERED_VIA_* constants or false on failure.
Perform an unauthenticated HTTP GET in an attempt to get redirected via 302 to the correct location to perform the HTTPS POST .