• Модуль: pull
  • Путь к файлу: ~/bitrix/modules/pull/lib/rest.php
  • Класс: BitrixPullRest
  • Вызов: Rest::pushConfigSet
static function pushConfigSet($params, $n, CRestServer $server)
{
	$params = array_change_key_case($params, CASE_UPPER);

	if(is_string($params['CONFIG']))
	{
		$params['CONFIG'] = CUtil::JsObjectToPhp($params['CONFIG']);
	}

	if (!is_array($params['CONFIG']) || empty($params['CONFIG']))
	{
		throw new BitrixRestRestException("New config is not specified", "CONFIG_ERROR", CRestServer::STATUS_WRONG_REQUEST);
	}

	$newConfig = Array();
	foreach ($params['CONFIG'] as $config)
	{
		if (
			!isset($config['module_id']) || empty($config['module_id'])
			|| !isset($config['type']) || empty($config['type'])
			|| !isset($config['active'])
		)
		{
			continue;
		}

		$newConfig[$config['module_id']][$config['type']] = (bool)$config['active'];
	}

	BitrixPullPush::setConfig($newConfig);

	return true;
}