• Модуль: pull
  • Путь к файлу: ~/bitrix/modules/pull/classes/general/pull_options.php
  • Класс: CPullOptions
  • Вызов: CPullOptions::CheckNeedRun
static function CheckNeedRun($bGetSectionStatus = true)
{
	$arExcludeSites = CPullOptions::GetExcludeSites();
	if (isset($arExcludeSites[SITE_ID]))
		return false;

	global $CACHE_MANAGER;

	$bAdminSection = false;
	if(defined("ADMIN_SECTION") && ADMIN_SECTION == true)
		$bAdminSection = true;

	$arResult = Array();
	$res = $CACHE_MANAGER->Read(2592000, "pull_cnr");
	if ($res)
		$arResult = $CACHE_MANAGER->Get("pull_cnr");

	if(!$res)
	{
		$arResult = Array(
			'ADMIN_SECTION' => false,
			'PUBLIC_SECTION' => false
		);

		$arModule = self::GetDependentModule();
		foreach ($arModule as $moduleId => $options)
		{
			if (isset($options['ADMIN_SECTION']) && $options['ADMIN_SECTION'] == 'Y')
				$arResult['ADMIN_SECTION'] = true;
			if (isset($options['PUBLIC_SECTION']) && $options['PUBLIC_SECTION'] == 'Y')
				$arResult['PUBLIC_SECTION'] = true;
		}

		$CACHE_MANAGER->Set("pull_cnr", $arResult);
	}

	return $bGetSectionStatus? $arResult[$bAdminSection? 'ADMIN_SECTION': 'PUBLIC_SECTION']: $arResult;
}