Auth_Yadis_Yadis::curlPresent PHP Method

curlPresent() static public method

static public curlPresent ( )
    static function curlPresent()
    {
        return function_exists('curl_init');
    }

Usage Example

Example #1
0
 /**
  * Returns an HTTP fetcher object.  If the CURL extension is
  * present, an instance of {@link Auth_Yadis_ParanoidHTTPFetcher}
  * is returned.  If not, an instance of
  * {@link Auth_Yadis_PlainHTTPFetcher} is returned.
  *
  * If Auth_Yadis_CURL_OVERRIDE is defined, this method will always
  * return a {@link Auth_Yadis_PlainHTTPFetcher}.
  */
 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;
 }
All Usage Examples Of Auth_Yadis_Yadis::curlPresent