• Модуль: imconnector
  • Путь к файлу: ~/bitrix/modules/imconnector/lib/update/update221000.php
  • Класс: BitrixImconnectorUpdateUpdate221000
  • Вызов: Update221000::checkPublicUrl
static function checkPublicUrl(): string
{
	if (
		!Loader::includeModule('bitrix24')
		&& Loader::includeModule(self::MODULE_ID)
	)
	{
		$publicUrl = Option::getRealValue(self::MODULE_ID, self::OPTION_ID, '');
		if (!empty($publicUrl))
		{
			$checkResult = BitrixImConnectorConnector::checkPublicUrl($publicUrl, false);
			if (!$checkResult->isSuccess())
			{
				if (Loader::includeModule('imbot'))
				{
					$publicUrl = Option::get('imbot', 'portal_url', '');
					if (!empty($publicUrl))
					{
						$checkResult = BitrixImConnectorConnector::checkPublicUrl($publicUrl, false);
						if ($checkResult->isSuccess())
						{
							Option::set(self::MODULE_ID, self::OPTION_ID, $publicUrl);
						}
					}
				}
				if (!$checkResult->isSuccess() && Loader::includeModule('imopenlines'))
				{
					$publicUrl = Option::get('imopenlines', 'portal_url', '');
					if (!empty($publicUrl))
					{
						$checkResult = BitrixImConnectorConnector::checkPublicUrl($publicUrl, false);
						if ($checkResult->isSuccess())
						{
							Option::set(self::MODULE_ID, self::OPTION_ID, $publicUrl);
						}
					}
				}
			}
		}
	}

	return '';
}