• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/component_util.php
  • Класс: CComponentUtil
  • Вызов: CComponentUtil::GetComponentDescr
static function GetComponentDescr($componentName)
{
	$componentName = trim($componentName);

	static $cache = array();

	if($componentName == '')
	{
		$arComponentDescription = false;
	}
	else
	{
		if(array_key_exists($componentName, $cache))
			return $cache[$componentName];

		$path2Comp = CComponentEngine::MakeComponentPath($componentName);
		if($path2Comp == '')
		{
			$arComponentDescription = false;
		}
		else
		{
			$componentPath = getLocalPath("components".$path2Comp);
			if(CComponentUtil::isComponent($componentPath))
			{
				$arComponentDescription = array();
				if(file_exists($_SERVER["DOCUMENT_ROOT"].$componentPath."/.description.php"))
				{
					CComponentUtil::__IncludeLang($componentPath, ".description.php");
					include($_SERVER["DOCUMENT_ROOT"].$componentPath."/.description.php");
				}
			}
			else
			{
				$arComponentDescription = false;
			}
		}
	}

	$cache[$componentName] = $arComponentDescription;
	return $arComponentDescription;
}