Decompresses compressed Response Content.
@access		public
@param		string		$content			Response Content, compressed
@param		string		$type				Compression Type used (gzip|deflate)
@return		string
766518
public static function decompressString( $content, $type = NULL )
	{
		if( !$type )
			return $content;
		ob_start();																					//  open a output buffer
		switch( strtolower( $type ) )
		{
			case 'deflate':
				$content	= self::inflate( $content );
				break;
			case 'gzip':
				xmp( $content );
				$content	= self::ungzip( $content );
				xmp( $content );
				break;
			default:
				ob_end_clean();
				throw new InvalidArgumentException( 'Decompression method "'.$type.'" is not supported' );
		}
		$output		= ob_get_clean();																//  close buffer for PHP error messages
		if( $content === FALSE && $output )															//  could not decompress
			throw new RuntimeException( $output );												//  throw exception and carry error message
		return $content;																				//  return decompressed response Content
	}
651932
public function compress($content)
    {
        $compressed = snappy_compress($content);

        if ($compressed === false) {
            throw new Exception\RuntimeException('Error while compressing.');
        }

        return $compressed;
    }
692401
public function compress($content)
    {
        // Increment recursion level only before doing a compression
        ini_set('pcre.recursion_limit', '16777');

        $content = $this->removeSpaces($content);
        $content = $this->removeComments($content);

        return $content;
    }
623657
public function getContent($content, $type, $father = null)
    {
        $array = ['type' => $type->getName(), 'size' => 'content-12'];

        if ($father) {
            $array['father'] = $father->getId();
            $subContent = $this->subContent->findOneBy(['child' => $content, 'father' => $father]);
            $array['size'] = $subContent->getSize();
        } else {
            $contentType = $this->contentType->findOneBy(['content' => $content, 'type' => $type]);
            $array['size'] = $contentType->getSize();
            $array['collapse'] = $contentType->isCollapse();
        }

        $array['content'] = $content;

        return $array;
    }
1063047
public function decompress($content)
    {
        $archive = str_replace(['/', '\\'], DIRECTORY_SEPARATOR, realpath($content));

        if (empty($archive) || !file_exists($archive)) {
            throw new Exception\RuntimeException('ZIP Archive not found');
        }

        $zip     = new ZipArchive();
        $res     = $zip->open($archive);

        $target = $this->getTarget();
        if (!empty($target) && !is_dir($target)) {
            $target = dirname($target);
        }

        if (!empty($target)) {
            $target = rtrim($target, '/\\') . DIRECTORY_SEPARATOR;
        }

        if (empty($target) || !is_dir($target)) {
            throw new Exception\RuntimeException('No target for ZIP decompression set');
        }

        if ($res !== true) {
            throw new Exception\RuntimeException($this->errorString($res));
        }

        $res = $zip->extractTo($target);
        if ($res !== true) {
            throw new Exception\RuntimeException($this->errorString($res));
        }

        $zip->close();
        return $target;
    }
986936
public function flush($content = null)
    {
        if (function_exists('apache_setenv')) {
            apache_setenv('no-gzip', '1');
        }

        /**
         * Disable zlib to compress output
         * @link http://www.php.net/manual/en/zlib.configuration.php
         */
        if (!headers_sent() && extension_loaded('zlib')) {
            ini_set('zlib.output_compression', '0');
        }

        /**
         * Turn implicit flush on
         * @link http://www.php.net/manual/en/function.ob-implicit-flush.php
         */
        ob_implicit_flush();

        $this->send($content);

        /**
         * Send blank characters for output_buffering
         * @link http://www.php.net/manual/en/outcontrol.configuration.php
         */
        if ($length = ini_get('output_buffering')) {
            echo str_pad('', $length);
        }

        while (ob_get_level()) {
            ob_end_flush();
        }

        return $this;
    }
1126932
public HttpResponse decompress() throws IOException {
    String enc = header("Content-Encoding");
    return (enc != null && enc.contains("gzip")) ? unzip() : this;
  }
197510
protected function unpack($content)
    {
        if ( !is_array($content) ) return null;

        if ( $content['ttl'] > 0 && time() >= $content['time'] + $content['ttl'] ) {
            $this->remove($content['key']);

            return null;
        }

        return $content['value'];
    }
1353493
public function postContent($type = 'content')
    {
        $output = [];

        if ($type === 'excerpt') {
            ob_start();
            the_excerpt();
            $output[] = ob_get_clean();
        } else {
            ob_start();
            the_content(sprintf(__('Continue reading %s', 'novusopress'), the_title('<span class="sr-only">', '</span>', false)));
            $output[] = ob_get_clean();
        }

        return apply_filters('novusopress_view_post_content_output', implode('', $output));
    }
237625
function setContentType( $typeAlias )
    {
        // expand short-hand notation for "php", json" etc
        if ( isset( self::$KnownContentTypes[$typeAlias] ) )
        {
            $this->ContentType = self::$KnownContentTypes[$typeAlias];
            return true;
        }
        // accept as well other mimetypes, as long as we later know how to encode them
        $decodableType = $this->mimeTypeToEncodeType( $typeAlias );
        if ( isset( self::$KnownContentTypes[$decodableType] ) )
        {
            $this->ContentType = $typeAlias;
            return true;
        }
        return false;
    }
1101299
public function decompress($content)
    {
        $archive = $this->getArchive();

        //check if there are null byte characters before doing a file_exists check
        if (!strstr($content, "\0") && file_exists($content)) {
            $archive = $content;
        }

        if (file_exists($archive)) {
            $file = bzopen($archive, 'r');
            if (!$file) {
                throw new Exception\RuntimeException("Error opening the archive '" . $content . "'");
            }

            $compressed = bzread($file);
            bzclose($file);
        } else {
            $compressed = bzdecompress($content);
        }

        if (is_int($compressed)) {
            throw new Exception\RuntimeException('Error during decompression');
        }

        return $compressed;
    }
1326778
public function fileContent($content)
    {
        if (is_resource($this->fileContent)) {
            fclose($this->fileContent);
        }

        $this->fileContent = $content;

        if (is_resource($content) && empty($this->fileType)) {
            $this->fileType($this->getTypeFromResource($content));
        }

        return $this;
    }
1249396
protected function formatContent($content)
    {
        if ($this->request->method == 'HEAD') {
            return (object) $this->headers;
        }

        if ($this->isXml()) {
            return json_decode($this->parseXml($content));
        }

        if ($this->isJson()) {
            return json_decode($content);
        }
    }
367077
public function decode_content($content) {
        if (!$content = $this->precheck_content($content)) { // Perform some prechecks
            return false;
        }
        // Iterate over all rules, chaining results
        foreach ($this->rules as $rule) {
            $content = $rule->decode($content);
        }
        return $content;
    }
254575
public function setContent($content)
    {
        if (is_null($this->mbRequest)) {
            return $this;
        }

        $this->prepare($this->mbRequest);

        if ($this->mbRequest->isMethod("GET") || $this->mbRequest->isMethod("DELETE")) {
            $this->statusCode = BaseResponse::HTTP_OK;
        } elseif ($this->mbRequest->isMethod("POST") || $this->mbRequest->isMethod("PUT")) {
            $this->statusCode = BaseResponse::HTTP_CREATED;
        } else {
            $this->statusCode = BaseResponse::HTTP_RESET_CONTENT;
        }

        if ($content instanceof \Exception) {
            $this->statusCode = $content->getCode();
            $this->statusCode = $this->isSuccessful() ? $this->statusCode : BaseResponse::HTTP_BAD_REQUEST;
        }

        if($this->isBuffer()){
            $this->original = $content;
        } elseif ($this->mbRequest->isAjax()) {
            $this->ajaxContent($content);
        } else {
            $this->htmlContent($content);
        }

        return $this;
    }
169030
public function fill($content)
    {
        if ($this->hasInstructions($content)) {
            $instructions = $this->getInstructions();
            foreach ($instructions as $instruction) {
                $content = $this->parseInstructions($content, $instruction);
            }
        }
        return $this->fillContent($content);
    }
310506
public function send($content = null, $type = null) 
    {
        if (!is_null($content)) {
            $this->setContents(is_array($content) ? $content : array($content));
        }
        if (!is_null($type)) {
            $this->setContentType($type);
        }
        return parent::send();
    }