lib/recurly/client.php
public function getFile($uri, $file_pointer) {
    $this->_verifyUri($uri);

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $uri);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, TRUE);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, FALSE);
    curl_setopt($ch, CURLOPT_MAXREDIRS, 1);
    curl_setopt($ch, CURLOPT_HEADER, FALSE); // do not return headers
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
      Recurly_Client::__userAgent(),
      'X-Api-Version: ' . Recurly_Client::$apiVersion
    ));
    curl_setopt($ch, CURLOPT_FILE, $file_pointer);

    $response = curl_exec($ch);

    if ($response === false) {
      $errorNumber = curl_errno($ch);
      $message = curl_error($ch);
      curl_close($ch);
      $this->_raiseCurlError($errorNumber, $message);
    }

    curl_close($ch);
  }
public function getFile($uri, $file_pointer) {
    $this->_verifyUri($uri);

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $uri);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, TRUE);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, FALSE);
    curl_setopt($ch, CURLOPT_MAXREDIRS, 1);
    curl_setopt($ch, CURLOPT_HEADER, FALSE); // do not return headers
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
      Recurly_Client::__userAgent(),
      'X-Api-Version: ' . Recurly_Client::$apiVersion
    ));
    curl_setopt($ch, CURLOPT_FILE, $file_pointer);

    $response = curl_exec($ch);

    if ($response === false) {
      $errorNumber = curl_errno($ch);
      $message = curl_error($ch);
      curl_close($ch);
      $this->_raiseCurlError($errorNumber, $message);
    }

    curl_close($ch);
  }
public function getFile ( $ uri , $ file_pointer ) { $ this -> _verifyUri ( $ uri ) ; $ ch = curl_init ( ) ; curl_setopt ( $ ch , CURLOPT_URL , $ uri ) ; curl_setopt ( $ ch , CURLOPT_SSL_VERIFYPEER , TRUE ) ; curl_setopt ( $ ch , CURLOPT_SSL_VERIFYHOST , 2 ) ; curl_setopt ( $ ch , CURLOPT_FOLLOWLOCATION , FALSE ) ; curl_setopt ( $ ch , CURLOPT_MAXREDIRS , 1 ) ; curl_setopt ( $ ch , CURLOPT_HEADER , FALSE ) ; // do not return headers curl_setopt ( $ ch , CURLOPT_RETURNTRANSFER , TRUE ) ; curl_setopt ( $ ch , CURLOPT_CONNECTTIMEOUT , 10 ) ; curl_setopt ( $ ch , CURLOPT_HTTPHEADER , array ( Recurly_Client :: __userAgent ( ) , 'X-Api-Version: ' . Recurly_Client :: $ apiVersion ) ) ; curl_setopt ( $ ch , CURLOPT_FILE , $ file_pointer ) ; $ response = curl_exec ( $ ch ) ; if ( $ response === false ) { $ errorNumber = curl_errno ( $ ch ) ; $ message = curl_error ( $ ch ) ; curl_close ( $ ch ) ; $ this -> _raiseCurlError ( $ errorNumber , $ message ) ; } curl_close ( $ ch ) ; }
Saves the contents of a URI into a file handle.

@param string    $uri          Target URI for the request (complete URL)
@param resource  $file_pointer Resourced returned from fopen() with write mode.
@throws Recurly_Error
Saves the contents of a URI into a file handle .