• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/update_class.php
  • Класс: CUpdateSystem
  • Вызов: CUpdateSystem::LoadModuleUpdates
static function LoadModuleUpdates($arModules, &$strError, $lang = false, $stableVersionsOnly = "Y")
{
	$strError_tmp = "";

	CUpdateSystem::AddMessage2Log("exec CUpdateSystem::LoadModuleUpdates");

	if ($lang===false)
		$lang = LANGUAGE_ID;

	$stableVersionsOnly = (($stableVersionsOnly == "N") ? "N" : "Y");

	if (!is_array($arModules))
	{
		$strError_tmp .= "[ULMU01] ".GetMessage("SUPP_LMU_NO_MODS").".
"; } if ($strError_tmp == '') { $arClientModules = CUpdateSystem::GetModules($strError_tmp, $arModules); for ($i = 0, $n = count($arModules); $i < $n; $i++) { if (!array_key_exists($arModules[$i], $arClientModules)) $arClientModules[$arModules[$i]] = ""; } if (!is_array($arClientModules) || empty($arClientModules)) { $strError_tmp .= "[ULMU02] ".GetMessage("SUPP_LMU_NO_MODS").".
"; } } if ($strError_tmp == '') { $GLOBALS["DB"]->GetVersion(); $strVars = "LICENSE_KEY=".urlencode(md5(CUpdateSystem::GetLicenseKey())). "&lang=".urlencode($lang). "&UTYPES=".urlencode("M"). "&ALL_MODULES=".urlencode("N"). "&TYPENC=".((defined("DEMO") && DEMO=="Y") ? "D" : ((defined("ENCODE") && ENCODE=="Y") ? "E" : "F" )). "&SUPD_VER=".urlencode(UPDATE_SYSTEM_VERSION). "&COUNT_ONLY=".urlencode("F"). "&CLIENT_SITE=".urlencode($_SERVER["SERVER_NAME"]). "&SUPD_STS=".urlencode(CUpdateSystem::GetFooPath("GetList")). "&CANGZIP=".urlencode((CUpdateSystem::IsGzipInstalled()) ? "Y" : "N"). "&CLIENT_PHPVER=".urlencode(phpversion()). "&SUPD_DBS=".urlencode($GLOBALS["DB"]->type). "&XE=".urlencode((isset($GLOBALS["DB"]->XE) && $GLOBALS["DB"]->XE) ? "Y" : "N"). "&stable=".urlencode($stableVersionsOnly). "&".CUpdateSystem::ModulesArray2Query($arClientModules, "bitm_"); CUpdateSystem::AddMessage2Log(preg_replace("/LICENSE_KEY=[^&]*/i", "LICENSE_KEY=X", $strVars)); $stime = CUpdateSystem::getmicrotime(); $content = CUpdateSystem::getHTTPPage("bit_sysserver.php", $strVars, $strError_tmp); CUpdateSystem::AddMessage2Log("TIME LoadModuleUpdates.getHTTPPage ".Round(CUpdateSystem::getmicrotime()-$stime, 3)." sec"); if ($content == '') $strError_tmp .= "[ULMU03] ".GetMessage("SUPP_AS_EMPTY_RESP").".
"; } if ($strError_tmp == '') { if (!($fp1 = fopen($_SERVER["DOCUMENT_ROOT"]."/bitrix/updates/update_archive.gz", "wb"))) { $strError_tmp .= "[ULMU04] ".str_replace("#FILE#", $_SERVER["DOCUMENT_ROOT"]."/bitrix/updates", GetMessage("SUPP_RV_ER_TEMP_FILE")).".
"; } } if ($strError_tmp == '') { fwrite($fp1, $content); fclose($fp1); if (!file_exists($_SERVER["DOCUMENT_ROOT"]."/bitrix/updates/update_archive.gz") || !is_file($_SERVER["DOCUMENT_ROOT"]."/bitrix/updates/update_archive.gz")) { $strError_tmp .= "[ULMU05] ".str_replace("#FILE#", $_SERVER["DOCUMENT_ROOT"]."/bitrix/updates/update_archive.gz", GetMessage("SUPP_LMU_NO_TMP_FILE")).".
"; } } if ($strError_tmp <> '') { CUpdateSystem::AddMessage2Log($strError_tmp, "CULMU"); $strError .= $strError_tmp; return false; } else return true; }