• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/update_class.php
  • Класс: CUpdateSystem
  • Вызов: CUpdateSystem::RunUpdaterScript
static function RunUpdaterScript($path, &$strError, $from_dir, $moduleID)
{
	global $DBType, $DB, $APPLICATION, $USER;

	if (!isset($GLOBALS["UPDATE_STRONG_UPDATE_CHECK"])
		|| ($GLOBALS["UPDATE_STRONG_UPDATE_CHECK"] != "Y" && $GLOBALS["UPDATE_STRONG_UPDATE_CHECK"] != "N"))
	{
		$GLOBALS["UPDATE_STRONG_UPDATE_CHECK"] = COption::GetOptionString("main", "strong_update_check", "Y");
	}
	$strongUpdateCheck = $GLOBALS["UPDATE_STRONG_UPDATE_CHECK"];

	$DOCUMENT_ROOT = $_SERVER["DOCUMENT_ROOT"];

	$path = str_replace("\", "/", $path);
	$updaterPath = dirname($path);
	$updaterPath = substr($updaterPath, strlen($_SERVER["DOCUMENT_ROOT"]));
	$updaterPath = Trim($updaterPath, " tnrx0B/\");
	if ($updaterPath <> '')
		$updaterPath = "/".$updaterPath;

	$updaterName = substr($path, strlen($_SERVER["DOCUMENT_ROOT"]));

	CUpdateSystem::AddMessage2Log("Run updater '".$updaterName."'", "CSURUS1");

	$updater = new CUpdater();
	$updater->Init($updaterPath, $DBType, $updaterName, $from_dir, $moduleID, "ALL");

	$errorMessage = "";

	if(file_exists($path))
		include($path);

	if ($errorMessage <> '')
		$strError .= $errorMessage;
	if (is_array($updater->errorMessage) && !empty($updater->errorMessage))
		$strError .= implode("n", $updater->errorMessage);

	unset($updater);
}