Decompress a deflated string. Once uncompressed, the uncompressed string is then used as the wrapped stream.
string $filter De-compression filter:
bool Returns TRUE on success or FALSE on failure
Overrides EntityBodyInterface::uncompress
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);
}