Auth_Yadis_Yadis::getHTTPFetcher PHP Method

getHTTPFetcher() static public method

If Auth_Yadis_CURL_OVERRIDE is defined, this method will always return a {@link Auth_Yadis_PlainHTTPFetcher}.
static public getHTTPFetcher ( $timeout = 20 )
    static function getHTTPFetcher($timeout = 20)
    {
        if (Auth_Yadis_Yadis::curlPresent() && !defined('Auth_Yadis_CURL_OVERRIDE')) {
            $fetcher = new Auth_Yadis_ParanoidHTTPFetcher($timeout);
        } else {
            $fetcher = new Auth_Yadis_PlainHTTPFetcher($timeout);
        }
        return $fetcher;
    }

Usage Example

Example #1
0
 function setUp()
 {
     $this->proxy_url = 'http://xri.example.com/';
     $this->fetcher = Auth_Yadis_Yadis::getHTTPFetcher();
     $this->proxy = new Auth_Yadis_ProxyResolver($fetcher, $this->proxy_url);
     $this->servicetype = 'xri://+i-service*(+forwarding)*($v*1.0)';
     $this->servicetype_enc = 'xri%3A%2F%2F%2Bi-service%2A%28%2Bforwarding%29%2A%28%24v%2A1.0%29';
 }
All Usage Examples Of Auth_Yadis_Yadis::getHTTPFetcher