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

	if ($arParams === 0)
	{
		$arParams = [];
	}

	if ($this->_checkParams($arParams,
			['no_compression' => false,
				'add_path' => "",
				'remove_path' => "",
				'remove_all_path' => false]) != 1)
	{
		return 0;
	}

	$arResultList = [];
	if (is_array($arFileList))
	{
		$res = $this->_createArchive($arFileList, $arResultList, $arParams);
	}
	else
	{
		if (is_string($arFileList))
		{
			$arTmpList = explode(",", $arFileList);
			$res = $this->_createArchive($arTmpList, $arResultList, $arParams);
		}
		else
		{
			$this->_errorLog("ERR_PARAM", GetMessage("MAIN_ZIP_ERR_PARAM"));
			$res = "ERR_PARAM";
		}
	}

	if ($res != 1)
	{
		return 0;
	}

	return $arResultList;
}