• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/composite/helper.php
  • Класс: BitrixMainCompositeshares
  • Вызов: shares::compileOptions
static function compileOptions(&$arOptions)
{
	$arOptions["~INCLUDE_MASK"] = array();
	$inc = str_replace(
		array("\", ".", "?", "*", "'"),
		array("/", "\.", ".", ".*?", "\'"),
		$arOptions["INCLUDE_MASK"]
	);
	$arIncTmp = explode(";", $inc);
	foreach ($arIncTmp as $mask)
	{
		$mask = trim($mask);
		if ($mask <> '')
		{
			$arOptions["~INCLUDE_MASK"][] = "'^".$mask."$'";
		}
	}

	$arOptions["~EXCLUDE_MASK"] = array();
	$exc = str_replace(
		array("\", ".", "?", "*", "'"),
		array("/", "\.", ".", ".*?", "\'"),
		$arOptions["EXCLUDE_MASK"]
	);
	$arExcTmp = explode(";", $exc);
	foreach ($arExcTmp as $mask)
	{
		$mask = trim($mask);
		if ($mask <> '')
		{
			$arOptions["~EXCLUDE_MASK"][] = "'^".$mask."$'";
		}
	}

	if (intval($arOptions["FILE_QUOTA"]) > 0)
	{
		$arOptions["~FILE_QUOTA"] = doubleval($arOptions["FILE_QUOTA"]) * 1024.0 * 1024.0;
	}
	else
	{
		$arOptions["~FILE_QUOTA"] = 0.0;
	}

	$arOptions["INDEX_ONLY"] = isset($arOptions["NO_PARAMETERS"]) && ($arOptions["NO_PARAMETERS"] === "Y");
	$arOptions["~GET"] = array();
	$onlyParams = explode(";", $arOptions["ONLY_PARAMETERS"]);
	foreach ($onlyParams as $str)
	{
		$str = trim($str);
		if ($str <> '')
		{
			$arOptions["~GET"][] = $str;
		}
	}

	$arOptions["~IGNORED_PARAMETERS"] = array();
	$ignoredParams = explode(";", $arOptions["IGNORED_PARAMETERS"]);
	foreach ($ignoredParams as $str)
	{
		$str = trim($str);
		if ($str <> '')
		{
			$arOptions["~IGNORED_PARAMETERS"][] = $str;
		}
	}

	$arOptions["~EXCLUDE_PARAMS"] = array();
	$excludeParams = explode(";", $arOptions["EXCLUDE_PARAMS"]);
	foreach ($excludeParams as $str)
	{
		$str = trim($str);
		if ($str <> '')
		{
			$arOptions["~EXCLUDE_PARAMS"][] = $str;
		}
	}

	if (defined("BX_STARTED"))
	{
		$arOptions["COMPRESS"] = false;
		$arOptions["STORE_PASSWORD"] = COption::GetOptionString("main", "store_password", "Y");
		$cookie_prefix = COption::GetOptionString('main', 'cookie_name', 'BITRIX_SM');
		$arOptions["COOKIE_LOGIN"] = $cookie_prefix.'_LOGIN';
		$arOptions["COOKIE_PASS"] = $cookie_prefix.'_UIDH';
		$arOptions["COOKIE_NCC"] = $cookie_prefix.'_NCC';
		$arOptions["COOKIE_CC"] = $cookie_prefix.'_CC';
		$arOptions["COOKIE_PK"] = $cookie_prefix.'_PK';
	}
}