public function content() {

    // XXX: This allows local overwrites. Is this a good idea?
    if (!empty($this->content)) {
      return $this->content;
    }

    // Get the object, content included.
    $response = $this->fetchObject(TRUE);

    $content = $response->content();

    // Checksum the content.
    // XXX: Right now the md5 is done even if checking is turned off.
    // Should fix that.
    $check = md5($content);
    if ($this->isVerifyingContent() && $check != $this->etag()) {
      throw new ContentVerificationException("Checksum $check does not match Etag " . $this->etag());
    }

    // If we are caching, set the content locally when we retrieve
    // remotely.
    if ($this->isCaching()) {
      $this->setContent($content);
    }

    return $content;
  }
public function content() {

    // XXX: This allows local overwrites. Is this a good idea?
    if (!empty($this->content)) {
      return $this->content;
    }

    // Get the object, content included.
    $response = $this->fetchObject(TRUE);

    $content = $response->content();

    // Checksum the content.
    // XXX: Right now the md5 is done even if checking is turned off.
    // Should fix that.
    $check = md5($content);
    if ($this->isVerifyingContent() && $check != $this->etag()) {
      throw new ContentVerificationException("Checksum $check does not match Etag " . $this->etag());
    }

    // If we are caching, set the content locally when we retrieve
    // remotely.
    if ($this->isCaching()) {
      $this->setContent($content);
    }

    return $content;
  }
public function content ( ) { // XXX: This allows local overwrites. Is this a good idea? if ( ! empty ( $ this -> content ) ) { return $ this -> content ; } // Get the object, content included. $ response = $ this -> fetchObject ( TRUE ) ; $ content = $ response -> content ( ) ; // Checksum the content. // XXX: Right now the md5 is done even if checking is turned off. // Should fix that. $ check = md5 ( $ content ) ; if ( $ this -> isVerifyingContent ( ) && $ check != $ this -> etag ( ) ) { throw new ContentVerificationException ( "Checksum $check does not match Etag " . $ this -> etag ( ) ) ; } // If we are caching, set the content locally when we retrieve // remotely. if ( $ this -> isCaching ( ) ) { $ this -> setContent ( $ content ) ; } return $ content ; }
Get the content of this object.

Since this is a proxy object, calling content() will cause the
object to be fetched from the remote data storage. The result will
be delivered as one large string.

The file size, content type, etag, and modification date of the
object are all updated during this command, too. This accounts for
the possibility that the content was modified externally between
the time this object was constructed and the time this method was
executed.

Be wary of using this method with large files.

@retval string
@return string
The contents of the file as a string.
@throws \HPCloud\Transport\FileNotFoundException
when the requested content cannot be located on the remote
server.
@throws \HPCloud\Exception
when an unknown exception (usually an abnormal network condition)
occurs.
Get the content of this object .