• Модуль: clouds
  • Путь к файлу: ~/bitrix/modules/clouds/classes/general/storage.php
  • Класс: CCloudStorage
  • Вызов: CCloudStorage::ResizeImageFileAdd
static function ResizeImageFileAdd(&$arDestinationSize, $sourceFile, $destinationFile, $arResizeParams, $errorCode = 0)
{
	global $DB;
	$destinationFile = preg_replace("/^https?:/i", "", $destinationFile);
	$destinationFile = CCloudUtil::URLEncode($destinationFile, "UTF-8", true);
	$q = $DB->Query("
		select
			ID
			,ERROR_CODE
			,PARAMS
			,".$DB->DateToCharFunction("TIMESTAMP_X", "FULL")." TIMESTAMP_X
		from b_clouds_file_resize
		where TO_PATH = '".$DB->ForSql($destinationFile)."'
	");

	$a = $q->Fetch();
	if ($a && $a["ERROR_CODE"] >= 10 && $a["ERROR_CODE"] < 20)
	{
		$DB->Query("DELETE from b_clouds_file_resize WHERE ID = ".$a["ID"]);
		$a = false;
	}

	if (!$a)
	{
		$arResizeParams["type"] = $sourceFile["CONTENT_TYPE"];
		$DB->Add("b_clouds_file_resize", array(
			"~TIMESTAMP_X" => $DB->CurrentTimeFunction(),
			"ERROR_CODE" => intval($errorCode),
			"PARAMS" => serialize($arResizeParams),
			"FROM_PATH" => CCloudUtil::URLEncode($sourceFile["SRC"], "UTF-8", true),
			"TO_PATH" => $destinationFile,
			"FILE_ID" => $sourceFile["ID"],
		));
	}
}