• Модуль: landing
  • Путь к файлу: ~/bitrix/modules/landing/lib/site/version.php
  • Класс: BitrixLandingSiteVersion
  • Вызов: Version::update
static function update(int $siteId, ?int $version = 0): void
{
	if (self::$process)
	{
		return;
	}
	self::$process = true;

	$version = intval($version);

	if ($version >= count(self::VERSIONS) - 1)
	{
		return;
	}

	BitrixLandingRights::setGlobalOff();

	foreach (self::VERSIONS as $updateVersion => $updateClass)
	{
		if ($updateVersion <= $version)
		{
			continue;
		}

		if (!$updateClass || !class_exists($updateClass))
		{
			continue;
		}

		if ($updateClass::update($siteId))
		{
			$version = $updateVersion;
		}
		else
		{
			break;
		}
	}

	BitrixLandingInternalsSiteTable::update($siteId, [
		'VERSION' => $version
	]);

	BitrixLandingRights::setGlobalOn();
	self::$process = false;
}