protected function fetchObject($fetchContent = FALSE) {
    $method = $fetchContent ? 'GET' : 'HEAD';

    $client = \HPCloud\Transport::instance();
    $headers = array(
      'X-Auth-Token' => $this->token,
    );

    if (empty($this->cdnUrl)) {
      $response = $client->doRequest($this->url, $method, $headers);
    }
    else {
      $response = $client->doRequest($this->cdnUrl, $method, $headers);
    }

    if ($response->status() != 200) {
      throw new \HPCloud\Exception('An unknown exception occurred during transmission.');
    }

    $this->extractFromHeaders($response);

    return $response;
  }
protected function fetchObject($fetchContent = FALSE) {
    $method = $fetchContent ? 'GET' : 'HEAD';

    $client = \HPCloud\Transport::instance();
    $headers = array(
      'X-Auth-Token' => $this->token,
    );

    if (empty($this->cdnUrl)) {
      $response = $client->doRequest($this->url, $method, $headers);
    }
    else {
      $response = $client->doRequest($this->cdnUrl, $method, $headers);
    }

    if ($response->status() != 200) {
      throw new \HPCloud\Exception('An unknown exception occurred during transmission.');
    }

    $this->extractFromHeaders($response);

    return $response;
  }
protected function fetchObject ( $ fetchContent = FALSE ) { $ method = $ fetchContent ? 'GET' : 'HEAD' ; $ client = \ HPCloud \ Transport :: instance ( ) ; $ headers = array ( 'X-Auth-Token' => $ this -> token , ) ; if ( empty ( $ this -> cdnUrl ) ) { $ response = $ client -> doRequest ( $ this -> url , $ method , $ headers ) ; } else { $ response = $ client -> doRequest ( $ this -> cdnUrl , $ method , $ headers ) ; } if ( $ response -> status ( ) != 200 ) { throw new \ HPCloud \ Exception ( 'An unknown exception occurred during transmission.' ) ; } $ this -> extractFromHeaders ( $ response ) ; return $ response ; }
Helper function for fetching an object.

@param boolean $fetchContent
If this is set to TRUE, a GET request will be issued, which will
cause the remote host to return the object in the response body.
The response body is not handled, though. If this is set to
FALSE, a HEAD request is sent, and no body is returned.
@retval HPCloud::Transport::Response
@return \HPCloud\Transport\Response
containing the object metadata and (depending on the
$fetchContent flag) optionally the data.
Helper function for fetching an object .