• Модуль: seo
  • Путь к файлу: ~/bitrix/modules/seo/lib/service.php
  • Класс: BitrixSeoService
  • Вызов: Service::getClientList
static function getClientList($engineCode = false)
{
	if( static::$clientList == null)
	{
		$cache = Application::getInstance()->getManagedCache();
		if ($cache->read(static::CLIENT_LIST_CACHE_TLL, static::CLIENT_LIST_CACHE_ID))
		{
			static::$clientList = $cache->get(static::CLIENT_LIST_CACHE_ID);
			static::$clientList = is_array(static::$clientList) ? static::$clientList : [];
		}
		else
		{
			$clientDataProvider = static::getEngine()->getInterface();
			$result = $clientDataProvider->getClientList();
			if (!is_array($result)) // backward compatibility
			{
				$result = [];
				$data = $clientDataProvider->getClientInfo();
				if (is_array($data))
				{
					foreach ($data as $code => $client)
					{
						$data['proxy_client_type'] = static::CLIENT_TYPE_COMPATIBLE;
						$data['engine_code'] = $code;
						$data['proxy_client_id'] = null;
						$result[] = $data;
					}
				}
			}
			else
			{
				$result = $result['items'];
			}
			$cache->set(static::CLIENT_LIST_CACHE_ID, $result);
			static::$clientList = $result;
		}
	}
	if ($engineCode)
	{
		return array_filter(static::$clientList, function ($item) use ($engineCode) {
			return $item['engine_code'] == $engineCode;
		});
	}
	return static::$clientList;
}