• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/composite/data/filestorage.php
  • Класс: BitrixMainCompositeDataFileStorage
  • Вызов: FileStorage::write
public function write($content, $md5)
{
	$written = false;
	
	if ($this->cacheFile)
	{
		$tempFile = new File($this->cacheFile->getPhysicalPath().".tmp");

		try
		{
			$written = $tempFile->putContents($content);
			$this->cacheFile->delete();
			if (!$tempFile->rename($this->cacheFile->getPhysicalPath()))
			{
				$written = false;
			}
		}
		catch (Exception $exception)
		{
			$written = false;
			$this->cacheFile->delete();
			$tempFile->delete();
		}
	}

	return $written;
}