• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/zip.php
  • Класс: CZip
  • Вызов: CZip::_extractFileAsString
private function _extractFileAsString($arEntry, &$string)
{
	//reading file header
	$header = [];
	if (($res = $this->_readFileHeader($header)) != 1)
	{
		return $res;
	}

	//to be checked: file header should be coherent with the $arEntry info

	//extract if not a folder
	if (!(($arEntry['external'] & 0x00000010) == 0x00000010))
	{
		//if not compressed
		if ($arEntry['compressed_size'] == $arEntry['size'])
		{
			$string = fread($this->zipfile, $arEntry['compressed_size']);
		}
		else
		{
			$data = fread($this->zipfile, $arEntry['compressed_size']);
			$string = gzinflate($data);
		}
	}
	else
	{
		$this->_errorLog("ERR_EXTRACT", GetMessage("MAIN_ZIP_ERR_EXTRACT"));
		return $this->arErrors;
	}

	return $res;
}