• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/data/taggedcache.php
  • Класс: BitrixMainDataTaggedCache
  • Вызов: TaggedCache::initDbCache
protected function initDbCache($path)
{
	if (!isset($this->cacheTag[$path]))
	{
		$this->cacheTag[$path] = [];

		$con = MainApplication::getConnection();
		$sqlHelper = $con->getSqlHelper();

		$this->pool->useMasterOnly(true);

		$rs = $con->query("
			SELECT TAG
			FROM b_cache_tag
			WHERE SITE_ID = '".$sqlHelper->forSql(SITE_ID, 2)."'
			AND CACHE_SALT = '".$sqlHelper->forSql($this->salt, 4)."'
			AND RELATIVE_PATH = '".$sqlHelper->forSql($path)."'
		");

		while ($ar = $rs->fetch())
		{
			$this->cacheTag[$path][$ar["TAG"]] = true;
		}

		$this->pool->useMasterOnly(false);
	}
}