FileFetcher::get PHP Method

get() static public method

Récupère le contenu d'un fichier
static public get ( string $url, $headers = null ) : mixed
$url string L'URL du fichier
return mixed Le contenu du fichier en cas de succès. FALSE en cas d'échec
    static function get($url, $headers = null)
    {
        if (function_exists('curl_init')) {
            return self::getCurl($url, $headers);
        }
        if (ini_get('allow_url_fopen')) {
            return self::getRemote($url);
        }
        return false;
    }

Usage Example

Example #1
0
 public function oauthRequest($params = array())
 {
     $method = $params[0];
     $additional_params = isset($params[1]) ? $params[1] : array();
     $sha1_method = new OAuthSignatureMethod_HMAC_SHA1();
     $consumer = new OAuthConsumer($this->oauth['app_consumer_key'], $this->oauth['app_consumer_secret']);
     $token = new OAuthConsumer($this->oauth['user_access_token'], $this->oauth['user_access_token_secret']);
     $request = OAuthRequest::from_consumer_and_token($consumer, $token, 'GET', 'http://api.twitter.com/1/' . $method . '.json', $additional_params);
     $request->sign_request($sha1_method, $consumer, $token);
     return FileFetcher::get($request->to_url());
 }
All Usage Examples Of FileFetcher::get