- Модуль: rest
- Путь к файлу: ~/bitrix/modules/rest/lib/preset/data/rest.php
- Класс: BitrixRestPresetDataRest
- Вызов: Rest::getAllBasicDescription
static function getAllBasicDescription() : array
{
$result = [
static::SCOPE => [],
static::METHOD => [],
static::PLACEMENT => [],
static::EVENT => [],
];
$cache = Cache::createInstance();
if ($cache->initCache(static::CACHE_TIME, 'allRestDescription' . LANGUAGE_ID, static::CACHE_DIR))
{
$result = $cache->getVars();
}
elseif ($cache->startDataCache())
{
$provider = new CRestProvider();
$allScope = $provider->getDescription();
foreach ($allScope as $scope => $list)
{
foreach ($list as $method => $data)
{
if ($method === '_events')
{
if (!isset($result[static::EVENT][$scope]))
{
$result[static::EVENT][$scope] = [];
}
$result[static::EVENT][$scope] = array_merge($result[static::EVENT][$scope], array_keys($data));
}
elseif ($method === '_placements')
{
if (!isset($result[static::PLACEMENT][$scope]))
{
$result[static::PLACEMENT][$scope] = [];
}
$result[static::PLACEMENT][$scope] = array_merge($result[static::PLACEMENT][$scope], array_keys($data));
}
else
{
$result[static::METHOD][$scope][] = $method;
}
}
}
$result[static::SCOPE] = array_keys($allScope);
$installedModuleList = ModuleManager::getInstalledModules();
foreach ($installedModuleList as $moduleId => $moduleDescription)
{
if (!isset($description[$moduleId]))
{
$controllersConfig = Configuration::getInstance($moduleId);
if (!empty($controllersConfig['controllers']['restIntegration']['enabled']))
{
$result[static::SCOPE][] = RestManager::getModuleScopeAlias($moduleId);
}
}
}
$result[static::SCOPE] = array_values(array_unique($result[static::SCOPE]));
$cache->endDataCache($result);
}
return $result;
}