From: marina Date: Thu, 26 Dec 2024 09:27:27 +0000 (+0300) Subject: cache reset X-Git-Tag: 1.7~107^2~3 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=00a95ddf1f9768721026a9673eb75092078384c1;p=erp24_rep%2Fyii-erp24%2F.git cache reset --- diff --git a/erp24/services/TelegramService.php b/erp24/services/TelegramService.php index 1b0ab9c9..03efba2b 100644 --- a/erp24/services/TelegramService.php +++ b/erp24/services/TelegramService.php @@ -24,7 +24,13 @@ class TelegramService { public static function isDevelopmentEnvironment($urlString = null) : bool { - $currentUrl = empty($urlString) ? Yii::$app->request->getHostInfo() : $urlString; + try { + $ip = Yii::$app->request->getHostInfo(); + } catch (\Exception $exception) { + $ip = Yii::$app->request->userIP; + } + + $currentUrl = empty($urlString) ? $ip : $urlString; return !str_contains($currentUrl, self::TARGET_PROD_URL); }