public function EntityBody::uncompress

Decompress a deflated string. Once uncompressed, the uncompressed string is then used as the wrapped stream.

Parameters

string $filter De-compression filter:

Return value

bool Returns TRUE on success or FALSE on failure

Overrides EntityBodyInterface::uncompress

File

drupal/core/vendor/guzzle/http/Guzzle/Http/EntityBody.php, line 108

Class

EntityBody
Entity body used with an HTTP request or response

Namespace

Guzzle\Http

Code

public function uncompress($filter = 'zlib.inflate') {
  $offsetStart = 0;

  // When inflating gzipped data, the first 10 bytes must be stripped
  // if a gzip header is present
  if ($filter == 'zlib.inflate') {

    // @codeCoverageIgnoreStart
    if (!$this
      ->isReadable() || $this
      ->isConsumed() && !$this
      ->isSeekable()) {
      return false;
    }

    // @codeCoverageIgnoreEnd
    if (stream_get_contents($this->stream, 3, 0) === "") {
      $offsetStart = 10;
    }
  }
  $this->contentEncoding = false;
  return $this
    ->handleCompression($filter, $offsetStart);
}