• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/update_class.php
  • Класс: CUpdateSystem
  • Вызов: CUpdateSystem::GetModules
static function GetModules(&$strError, $arSelected = false)
{
	$arClientModules = array();

	$handle = @opendir($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules");
	if ($handle)
	{
		if ($arSelected===false || is_array($arSelected) && in_array("main", $arSelected))
		{
			if (defined("SM_VERSION") && SM_VERSION <> '')
			{
				$arClientModules["main"] = SM_VERSION;
			}
			else
			{
				CUpdateSystem::AddMessage2Log(GetMessage("SUPP_GM_ERR_DMAIN"), "Ux09");
				$strError .= "[Ux09] ".GetMessage("SUPP_GM_ERR_DMAIN").".
"; } } while (false !== ($dir = readdir($handle))) { if (is_dir($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/".$dir) && $dir!="." && $dir!=".." && $dir!="main") { if ($arSelected===false || is_array($arSelected) && in_array($dir, $arSelected)) { $module_dir = $_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/".$dir; if (file_exists($module_dir."/install/index.php")) { $arInfo = CUpdateSystem::GetModuleInfo($module_dir); if (!isset($arInfo["VERSION"]) || $arInfo["VERSION"] == '') { CUpdateSystem::AddMessage2Log(str_replace("#MODULE#", $dir, GetMessage("SUPP_GM_ERR_DMOD")), "Ux11"); $strError .= "[Ux11] ".str_replace("#MODULE#", $dir, GetMessage("SUPP_GM_ERR_DMOD")).".
"; } else { $arClientModules[$dir] = $arInfo["VERSION"]; } } else { CUpdateSystem::AddMessage2Log(str_replace("#MODULE#", $dir, GetMessage("SUPP_GM_ERR_DMOD")), "Ux12"); $strError .= "[Ux12] ".str_replace("#MODULE#", $dir, GetMessage("SUPP_GM_ERR_DMOD")).".
"; } } } } closedir($handle); } else { CUpdateSystem::AddMessage2Log(GetMessage("SUPP_GM_NO_KERNEL"), "Ux15"); $strError .= "[Ux15] ".GetMessage("SUPP_GM_NO_KERNEL").".
"; } return $arClientModules; }