• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/controller_member.php
  • Класс: CControllerTools
  • Вызов: CControllerTools::PackFileArchive
static function PackFileArchive($path)
{
	include_once(__DIR__ . '/tar_gz.php');

	if (file_exists($path))
	{
		$path = realpath($path);

		$arcname = CTempFile::GetFileName(BitrixMainSecurityRandom::getString(32).'.tar.gz');
		CheckDirPath($arcname);
		$ob = new CArchiver($arcname);

		$rem_path = dirname($path);

		if ($ob->Add(array($path), false, $rem_path))
		{
			return $arcname;
		}
	}

	return false;
}