Rest::applicationConfigGet: метод Битрикс
Постоянная ссылка: http://bxapi.ru/src/?id=469983
<?php
// Rest::applicationConfigGet()
// /bitrix/modules/pull/lib/rest.php:125
public static function applicationConfigGet($params, $n, \CRestServer $server)
{
$params = array_change_key_case($params, CASE_UPPER);
$clientId = $server->getClientId();
if (!$clientId)
{
throw new \Bitrix\Rest\RestException("Get access to application config available only for application authorization.", "WRONG_AUTH_TYPE", \CRestServer::STATUS_FORBIDDEN);
}
$configParams = Array();
$configParams['CACHE'] = $params['CACHE'] != 'N';
$configParams['REOPEN'] = $params['REOPEN'] != 'N';
$configParams['CUSTOM_TYPE'] = $clientId;
$configParams['JSON'] = true;
$config = \Bitrix\Pull\Config::get($configParams);
if (!$config)
{
throw new \Bitrix\Rest\RestException("Push & Pull server is not configured", "SERVER_ERROR", \CRestServer::STATUS_INTERNAL);
}
return $config;
}