function QueryBatch($queryPath, $tableName = "") { if (!in_array("DATABASE", $this->callType)) return False; CUpdateSystem::AddMessage2Log("Run updater '".$this->updater."': QueryBatch(".$queryPath.", ".$tableName.")", "CRUPDCDF3"); $bCanUpdate = True; if (strlen($tableName) > 0) if (!$this->TableExists($tableName)) $bCanUpdate = False; $result = False; if ($bCanUpdate) { $strQueryPath = ""; if (is_array($queryPath)) { foreach ($queryPath as $key => $value) { if ($this->dbType == StrToUpper($key)) { $strQueryPath = $value; break; } } } else { $strQueryPath = $queryPath; } if (strlen($strQueryPath) <= 0) $bCanUpdate = False; } if ($bCanUpdate) { if (substr($strQueryPath, 0, 1) != "/") $strQueryPath = $this->curPath."/".$strQueryPath; $queryPathFull = $_SERVER["DOCUMENT_ROOT"].$strQueryPath; $arError = False; if (file_exists($queryPathFull)) $arError = $GLOBALS["DB"]->RunSQLBatch($queryPathFull); if ($arError) { foreach ($arError as $key => $value) $this->errorMessage[] = $value; } } return ($arError ? False : True); }
public static function LoadModuleNoDemand($moduleId, &$strError, $stableVersionsOnly = "Y", $lang = false) { $strError_tmp = ""; CUpdateClientPartner::AddMessage2Log("exec CUpdateClientPartner::LoadModuleNoDemand"); $stableVersionsOnly = $stableVersionsOnly == "N" ? "N" : "Y"; if ($lang === false) { $lang = LANGUAGE_ID; } $strQuery = CUpdateClientPartner::__CollectRequestData($strError_tmp, $lang, $stableVersionsOnly, array($moduleId), array(), true); if ($strQuery === False || StrLen($strQuery) <= 0 || StrLen($strError_tmp) > 0) { if (StrLen($strError_tmp) <= 0) { $strError_tmp = "[GNSU01] " . GetMessage("SUPZ_NO_QSTRING") . ". "; } } if (StrLen($strError_tmp) <= 0) { CUpdateClientPartner::AddMessage2Log(preg_replace("/LICENSE_KEY=[^&]*/i", "LICENSE_KEY=X", $strQuery)); $stime = CUpdateClientPartner::__GetMicroTime(); $content = CUpdateClientPartner::__GetHTTPPage("MODULE", $strQuery, $strError_tmp); if (strlen($content) <= 0) { if (StrLen($strError_tmp) <= 0) { $strError_tmp = "[GNSU02] " . GetMessage("SUPZ_EMPTY_ANSWER") . ". "; } } CUpdateClientPartner::AddMessage2Log("TIME LoadModuleNoDemand(request) " . Round(CUpdateClientPartner::__GetMicroTime() - $stime, 3) . " sec"); } if (StrLen($strError_tmp) <= 0) { if (!($fp1 = fopen($_SERVER["DOCUMENT_ROOT"] . "/bitrix/updates/update_archive.gz", "wb"))) { $strError_tmp = "[GNSU03] " . str_replace("#FILE#", $_SERVER["DOCUMENT_ROOT"] . "/bitrix/updates", GetMessage("SUPP_RV_ER_TEMP_FILE")) . ". "; } } if (StrLen($strError_tmp) <= 0) { fwrite($fp1, $content); fclose($fp1); } if (strlen($strError_tmp) <= 0) { $temporaryUpdatesDir = ""; if (!CUpdateClientPartner::UnGzipArchive($temporaryUpdatesDir, $strError_tmp, true)) { $strError_tmp .= "[CL02] " . GetMessage("SUPC_ME_PACK") . ". "; CUpdateClientPartner::AddMessage2Log(GetMessage("SUPC_ME_PACK"), "CL02"); } } $arStepUpdateInfo = array(); if (strlen($strError_tmp) <= 0) { $arStepUpdateInfo = CUpdateClientPartner::GetStepUpdateInfo($temporaryUpdatesDir, $strError_tmp); } if (StrLen($strError_tmp) <= 0) { if (isset($arStepUpdateInfo["DATA"]["#"]["ERROR"])) { for ($i = 0, $cnt = count($arStepUpdateInfo["DATA"]["#"]["ERROR"]); $i < $cnt; $i++) { $strError_tmp .= "[" . $arStepUpdateInfo["DATA"]["#"]["ERROR"][$i]["@"]["TYPE"] . "] " . $arStepUpdateInfo["DATA"]["#"]["ERROR"][$i]["#"]; } } } if (strlen($strError_tmp) <= 0) { if (!CUpdateClientPartner::UpdateStepModules($temporaryUpdatesDir, $strError_tmp)) { $strError_tmp .= "[CL04] " . GetMessage("SUPC_ME_UPDATE") . ". "; CUpdateClientPartner::AddMessage2Log(GetMessage("SUPC_ME_UPDATE"), "CL04"); } } if (strlen($strError_tmp) > 0) { CUpdateSystem::AddMessage2Log($strError_tmp, "CURV"); $strError .= $strError_tmp; return False; } else { return True; } }
?> <br> <i><?php echo $arErrorHelp[$arHelpUpdates["HELPS"]["#"]["HELP"][$i]["@"]["ID"]]; ?> </i> <br><br> <?php CUpdateSystem::AddMessage2Log(str_replace("#DATE#", Date($strPHPDateFormat, $dDate), str_replace("#HELP#", $arHelpUpdates["HELPS"]["#"]["HELP"][$i]["@"]["NAME"] . " (" . $arHelpUpdates["HELPS"]["#"]["HELP"][$i]["@"]["ID"] . ")", GetMessage("SUP_HSTEP3_UPD_LOG"))) . " " . $arErrorHelp[$arHelpUpdates["HELPS"]["#"]["HELP"][$i]["@"]["ID"]], "UPD_ERROR"); } elseif (array_key_exists($arHelpUpdates["HELPS"]["#"]["HELP"][$i]["@"]["ID"], $arSuccessHelp)) { $dDate = mktime(0, 0, 0, substr($arHelpUpdates["HELPS"]["#"]["HELP"][$i]["@"]["DATE"], 4, 2), substr($arHelpUpdates["HELPS"]["#"]["HELP"][$i]["@"]["DATE"], 6, 2), substr($arHelpUpdates["HELPS"]["#"]["HELP"][$i]["@"]["DATE"], 0, 4)); echo str_replace("#DATE#", Date($strPHPDateFormat, $dDate), str_replace("#HELP#", $arHelpUpdates["HELPS"]["#"]["HELP"][$i]["@"]["NAME"] . " (" . $arHelpUpdates["HELPS"]["#"]["HELP"][$i]["@"]["ID"] . ")", GetMessage("SUP_HSTEP3_UPD_SUC"))); ?> <br><br> <?php CUpdateSystem::AddMessage2Log(str_replace("#DATE#", Date($strPHPDateFormat, $dDate), str_replace("#HELP#", $arHelpUpdates["HELPS"]["#"]["HELP"][$i]["@"]["NAME"] . " (" . $arHelpUpdates["HELPS"]["#"]["HELP"][$i]["@"]["ID"] . ")", GetMessage("SUP_HSTEP3_UPD_LOG"))), "UPD_SUCCESS"); } else { echo str_replace("#HELP#", $arHelpUpdates["HELPS"]["#"]["HELP"][$i]["@"]["NAME"] . " (" . $arHelpUpdates["HELPS"]["#"]["HELP"][$i]["@"]["ID"] . ")", GetMessage("SUP_HSTEP3_UPD_NONE")); ?> <br><br> <?php } } } ?> <br><br> <br> <a href="sysupdate.php?TYPE=HISTORY&lang=<?php echo LANG; ?>