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

	$rule = $this->GetOptions()['RULE'];

	$arParams = [
		"add_path" => $this->add_path,
		"remove_path" => $this->remove_path,
		"extract_as_string" => false,
		"remove_all_path" => false,
		"callback_pre_extract" => "",
		"callback_post_extract" => "",
		"set_chmod" => 0,
		"by_name" => "",
		"by_index" => array_key_exists("by_index", $rule) ? $rule['by_index'] : "",
		"by_preg" => "",
	];

	@set_time_limit(0);
	$result = $this->Extract($arParams);

	if ($result === 0)
	{
		return false;
	}
	//if there was no error, but we didn't extract any file ($this->replaceExistentFile = false)
	else
	{
		if ($result == [])
		{
			return true;
		}
		else
		{
			return $result;
		}
	}
}