13 protected const URL =
'/analytics.php';
35 public function send(): bool
46 Main\Application::getInstance()->getLicense()->getDomainStoreLicense() . self::URL,
49 if (!
$response || $httpClient->getStatus() !== 200)
74 private function getCommonData():
array
76 $isB24 = self::isB24();
78 'type' => $isB24 ?
'b24' :
'self_hosted',
81 'host_name' => self::getHostName(),
86 $data[
'tariff'] = \CBitrix24::getLicensePrefix();
102 $requestHash = md5(serialize(
$request));
104 if (
Main\Loader::includeModule(
'bitrix24'))
106 return \CBitrix24::RequestSign($requestHash);
109 $privateKey = Main\Analytics\Counter::getPrivateKey();
110 return md5($requestHash.$privateKey);
116 private static function getHostName(): string
120 $hostName = BX24_HOST_NAME;
124 $hostName = Main\Config\Option::get(
'main',
'server_name');
127 $hostName = (defined(
'SITE_SERVER_NAME') && !empty(SITE_SERVER_NAME)) ? SITE_SERVER_NAME :
'';
132 $request = Main\Context::getCurrent()->getRequest();
133 $hostName =
$request->getHttpHost();
137 return (
string)$hostName;
143 private static function isB24(): bool
145 return Main\Loader::includeModule(
'bitrix24');
static encode($data, $options=null)