• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/update_b24.php
  • Класс: CB24Updater
  • Вызов: CB24Updater::CheckUpdates
public function CheckUpdates()
{
	$arDBVersions = self::GetDatabaseVersions();
	if (empty($arDBVersions))
	{
		$this->CollectDatabaseVersions("ALL");
		$arDBVersions = self::GetDatabaseVersions();
	}

	$arFileVersions = $this->GetFileVersions();

	$arResult = array();
	foreach ($arFileVersions as $moduleId => $version)
	{
		if (($this->isProcessingMain && ($moduleId !== "main"))
			|| (!$this->isProcessingMain && ($moduleId === "main")))
			continue;

		if (CUpdateClient::CompareVersions($version, $arDBVersions[$moduleId]) > 0)
			$arResult[$moduleId] = $arDBVersions[$moduleId];
	}

	// Das ist strashnyy kostyl' for new Options
	global $DB;

	if ($this->isProcessingMain && !empty($arResult))
	{
		if(!$DB->TableExists("b_option_site"))
		{
			$DB->Query("
				CREATE TABLE b_option_site
				(
					MODULE_ID VARCHAR(50) not null,
					NAME VARCHAR(50) not null,
					SITE_ID CHAR(2) not null,
					VALUE TEXT,
					PRIMARY KEY(MODULE_ID, NAME, SITE_ID),
					INDEX ix_option_site_module_site(MODULE_ID, SITE_ID)
				)
			", true);
		}
		if(!$DB->Query("SELECT UNIQUE_ID FROM b_module_to_module WHERE 1=0", true))
		{
			$DB->Query("ALTER TABLE b_module_to_module ADD UNIQUE_ID VARCHAR(32) NOT NULL", true);
		}
	}
	// End of strashnyy kostyl'

	return $arResult;
}