• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/data/appcachemanifest.php
  • Класс: BitrixMainDataAppCacheManifest
  • Вызов: AppCacheManifest::generate
public function generate(&$content)
{
	$manifest = AppCacheManifest::getInstance();
	$files = $manifest->getFilesFromContent($content);

	$this->isModified = false;
	$manifestId = $this->getCurrentManifestID();

	if ($this->isSided)
	{
		$curManifestId = $this->getManifestID($this->pageURI, $this->receivedCacheParams);
		if ($curManifestId != $manifestId)
		{
			self::removeManifestById($curManifestId);
		}
	}

	$currentHashSum = md5(serialize($files["FULL_FILE_LIST"]) . serialize($this->fallbackPages) . serialize($this->network) . serialize($this->excludeImagePatterns));
	$manifestCache = $this->readManifestCache($manifestId);
	if (!$manifestCache || $manifestCache["FILE_HASH"] != $currentHashSum || self::$debug)
	{
		$this->isModified = true;
		$this->setFiles($files["FULL_FILE_LIST"]);
		$this->setNetworkFiles(Array("*"));
		$arFields = array(
			"ID" => $manifestId,
			"TEXT" => $this->getManifestContent(),
			"FILE_HASH" => $currentHashSum,
			"EXCLUDE_PATTERNS_HASH"=> md5(serialize($this->excludeImagePatterns)),
			"FILE_DATA" => Array(
				"FILE_TIMESTAMPS" => $files["FILE_TIMESTAMPS"],
				"CSS_FILE_IMAGES" => $files["CSS_FILE_IMAGES"]
			)
		);

		if (!self::$debug)
		{
			$this->writeManifestCache($arFields);
		}
		else
		{
			$jsFields = json_encode($arFields);
			$fileCount = count($this->files);
			$params = json_encode($this->params);
			$fileCountImages = 0;
			foreach ($arFields["FILE_DATA"]["CSS_FILE_IMAGES"] as $file=>$images)
			{
				$fileCountImages += count($images);
			}


			$debugOutput = <<getIsModified();
}