• Модуль: rest
  • Путь к файлу: ~/bitrix/modules/rest/lib/configuration/structure.php
  • Класс: BitrixRestConfigurationStructure
  • Вызов: Structure::unpack
public function unpack($fileInfo)
{
	$result = false;
	$fileContent = File::getFileContents($fileInfo["tmp_name"]);
	if ($fileContent)
	{
		$type = (in_array($fileInfo["type"], $this->zipMimeType)) ? 'ZIP' : 'TAR.GZ';
		$folder = $this->getFolder();
		$filePath = $folder.'archive_tmp';

		File::putFileContents($filePath, $fileContent);
		$archive = CBXArchive::GetArchive($filePath, $type);
		$res = $archive->Unpack($folder);
		if ($res)
		{
			$this->initUnpackFilesList();
			$result = true;
		}
		File::deleteFile($filePath);
	}

	return $result;
}