Source code for file /joomla/filesystem/archive/gzip.php
Documentation is available at gzip.php
* @version $Id: archive.php 6138 2007-01-02 03:44:18Z eddiea $
* @package Joomla.Framework
* @copyright Copyright (C) 2005 - 2007 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
// Check to ensure this file is within the rest of the framework
* Gzip format adapter for the JArchive class
* This class is inspired from and draws heavily in code and concept from the Compress package of
* The Horde Project <http://www.horde.org>
* @package Joomla.Framework
* Extract a Gzip compressed file to a given path
* @param string $archive Path to ZIP archive to extract
* @param string $destination Path to extract archive to
* @param array $options Extraction options [unused]
* @return boolean True if successful
function extract($archive, $destination, $options =
array ())
$this->set('error.message', 'Zlib Not Supported');
$this->set('error.message', 'Unable to read archive');
$this->set('error.message', 'Unable to decompress data');
if (JFile::write($destination, $buffer) ===
false) {
$this->set('error.message', 'Unable to write archive');
* Get file data offset for archive
* @return int Data position marker for archive
// gzipped file... unpack it first
$this->set('error.message', 'Unable to decompress data');
if ($info['FLG'] & $this->_flags['FEXTRA']) {
if ($info['FLG'] & $this->_flags['FNAME']) {
$filename =
substr($this->_data, $position, $filenamePos -
$position);
$position =
$filenamePos +
1;
if ($info['FLG'] & $this->_flags['FCOMMENT']) {
$comment =
substr($this->_data, $position, $commentPos -
$position);
$position =
$commentPos +
1;
if ($info['FLG'] & $this->_flags['FHCRC']) {