• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/zip.php
  • Класс: CZip
  • Вызов: CZip::GetProperties
public function GetProperties()
{
	$this->_errorReset();

	if (!$this->_checkFormat())
	{
		return (0);
	}

	$arProperties = [];
	$arProperties['comment'] = '';
	$arProperties['nb'] = 0;
	$arProperties['status'] = 'not_exist';

	if (@is_file($this->io->GetPhysicalName($this->zipname)))
	{
		if (($this->zipfile = @fopen($this->io->GetPhysicalName($this->zipname), 'rb')) == 0)
		{
			$this->_errorLog("ERR_READ", str_replace("#FILE_NAME#", removeDocRoot($this->zipname), GetMessage("MAIN_ZIP_ERR_READ")));
			return 0;
		}

		//read central directory info
		$arCentralDirInfo = [];
		if (($this->_readEndCentralDir($arCentralDirInfo)) != 1)
		{
			return 0;
		}

		$this->_closeFile();

		//set user attributes
		$arProperties['comment'] = $arCentralDirInfo['comment'];
		$arProperties['nb'] = $arCentralDirInfo['entries'];
		$arProperties['status'] = 'ok';
	}

	return $arProperties;
}