*/ class Mage_Archive_Helper_File_Gz extends Mage_Archive_Helper_File { /** * @see Mage_Archive_Helper_File::_open() */ protected function _open($mode) { $this->_fileHandler = @gzopen($this->_filePath, $mode); if (false === $this->_fileHandler) { throw new Mage_Exception('Failed to open file ' . $this->_filePath); } } /** * @see Mage_Archive_Helper_File::_write() */ protected function _write($data) { $result = @gzwrite($this->_fileHandler, $data); if (empty($result) && !empty($data)) { throw new Mage_Exception('Failed to write data to ' . $this->_filePath); } } /** * @see Mage_Archive_Helper_File::_read() */ protected function _read($length) { return gzread($this->_fileHandler, $length); } /** * @see Mage_Archive_Helper_File::_eof() */ protected function _eof() { return gzeof($this->_fileHandler); } /** * @see Mage_Archive_Helper_File::_close() */ protected function _close() { gzclose($this->_fileHandler); } }