• Модуль: rest
  • Путь к файлу: ~/bitrix/modules/rest/lib/configuration/structure.php
  • Класс: BitrixRestConfigurationStructure
  • Вызов: Structure::unpackSmallFiles
public function unpackSmallFiles($content): bool
{
	$result = true;
	try
	{
		$files = Json::decode($content);
		if (is_array($files))
		{
			$folder = $this->getFolder();
			foreach ($files as $file)
			{
				if (!empty($file['CONTENT']))
				{
					$id = (int)$file['ID'];
					if ($id > 0)
					{
						File::putFileContents(
							$folder . Helper::STRUCTURE_FILES_NAME . '/' . $id,
							base64_decode($file['CONTENT'])
						);
						unset($file['CONTENT']);
						if (File::isFileExists($folder . Helper::STRUCTURE_FILES_NAME . '/' . $id))
						{
							$file['PATH'] = $folder . Helper::STRUCTURE_FILES_NAME . '/' . $id;
							$this->setting->set(self::CODE_UNPACK_FILE_PREFIX . $id, $file);
						}
					}
				}
			}
		}
	}
	catch (Exception $e)
	{
		$result = false;
	}

	return $result;
}