12 class Gz extends \Magento\Framework\Archive\Helper\File
20 if (!extension_loaded(
'zlib')) {
21 throw new \RuntimeException(
'PHP extension zlib is required.');
23 $this->_fileHandler = gzopen($this->_filePath,
$mode);
25 if (
false === $this->_fileHandler) {
26 throw new \Magento\Framework\Exception\LocalizedException(
27 new \
Magento\Framework\
Phrase(
'The "%1" file failed to open.', [$this->_filePath])
40 throw new \Magento\Framework\Exception\LocalizedException(
41 new \
Magento\Framework\
Phrase(
'The data failed to write to "%1".', [$this->_filePath])
49 protected function _read($length)
51 return gzread($this->_fileHandler, $length);
59 return gzeof($this->_fileHandler);
67 gzclose($this->_fileHandler);
if($exist=($block->getProductCollection() && $block->getProductCollection() ->getSize())) $mode