private function extractFile(array $file)
    {
        $this->seek($file['offset']);

        $contents = $this->read($file['size']['compressed']);

        if ($file['flags'] & self::BZ2) {
            if (!$this->compression['bzip2']) {
                throw new RuntimeException(
                    "The \"bz2\" extension is required to decompress \"{$file['name']['data']}\"."
                );
            }

            $contents = bzdecompress($contents);
        } elseif ($file['flags'] & self::GZ) {
            if (!$this->compression['gzip']) {
                throw new RuntimeException(
                    "The \"zlib\" extension is required to decompress \"{$file['name']['data']}\"."
                );
            }

            $contents = gzinflate($contents);
        }

        return $contents;
    }
private function extractFile(array $file)
    {
        $this->seek($file['offset']);

        $contents = $this->read($file['size']['compressed']);

        if ($file['flags'] & self::BZ2) {
            if (!$this->compression['bzip2']) {
                throw new RuntimeException(
                    "The \"bz2\" extension is required to decompress \"{$file['name']['data']}\"."
                );
            }

            $contents = bzdecompress($contents);
        } elseif ($file['flags'] & self::GZ) {
            if (!$this->compression['gzip']) {
                throw new RuntimeException(
                    "The \"zlib\" extension is required to decompress \"{$file['name']['data']}\"."
                );
            }

            $contents = gzinflate($contents);
        }

        return $contents;
    }
private function extractFile ( array $ file ) { $ this -> seek ( $ file [ 'offset' ] ) ; $ contents = $ this -> read ( $ file [ 'size' ] [ 'compressed' ] ) ; if ( $ file [ 'flags' ] & self :: BZ2 ) { if ( ! $ this -> compression [ 'bzip2' ] ) { throw new RuntimeException ( "The \"bz2\" extension is required to decompress \"{$file['name']['data']}\"." ) ; } $ contents = bzdecompress ( $ contents ) ; } elseif ( $ file [ 'flags' ] & self :: GZ ) { if ( ! $ this -> compression [ 'gzip' ] ) { throw new RuntimeException ( "The \"zlib\" extension is required to decompress \"{$file['name']['data']}\"." ) ; } $ contents = gzinflate ( $ contents ) ; } return $ contents ; }
Returns the contents of a file from the archive.

@param array $file The file information from the archive.

@return string The decompressed file contents.

@throws RuntimeException If the file could not be decompressed.
Returns the contents of a file from the archive .