uawdijnntqw1x1x1
IP : 3.147.67.34
Hostname : axolotl
Kernel : Linux axolotl 4.9.0-13-amd64 #1 SMP Debian 4.9.228-1 (2020-07-05) x86_64
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
OS : Linux
PATH:
/
var
/
www
/
axolotl
/
data
/
www
/
msk.axolotls.ru
/
bitrix
/
modules
/
pull
/
lib
/
config.php
/
/
<?php namespace Bitrix\Pull; use Bitrix\Main\Localization\Loc; use Bitrix\Pull\SharedServer\Client; Loc::loadMessages(__FILE__); class Config { public static function get($params = array()) { if (!\CPullOptions::GetQueueServerStatus()) return false; $userId = (int)$params['USER_ID']; if ($userId == 0) { global $USER; $userId = (int)$USER->GetID(); } if ($userId == 0) { return false; } $cache = $params['CACHE'] !== false; $reopen = $params['REOPEN'] !== false; $privateChannelType = isset($params['CUSTOM_TYPE'])? $params['CUSTOM_TYPE']: \CPullChannel::TYPE_PRIVATE; $sharedChannelType = isset($params['CUSTOM_TYPE'])? $params['CUSTOM_TYPE']: \CPullChannel::TYPE_SHARED; $privateChannel = \CPullChannel::Get($userId, $cache, $reopen, $privateChannelType); $sharedChannel = \CPullChannel::GetShared($cache, $reopen, $sharedChannelType); $domain = defined('BX24_HOST_NAME')? BX24_HOST_NAME: $_SERVER['SERVER_NAME']; $isSharedMode = \CPullOptions::IsServerShared(); $serverConfig = Array( 'VERSION' => \CPullOptions::GetQueueServerVersion(), 'SERVER_ENABLED' => \CPullOptions::GetQueueServerStatus(), 'MODE' => \CPullOptions::GetQueueServerMode(), 'LONG_POLLING' => $isSharedMode ? \Bitrix\Pull\SharedServer\Config::getLongPollingUrl(): \CPullOptions::GetListenUrl(), 'LONG_POOLING_SECURE' => $isSharedMode ? \Bitrix\Pull\SharedServer\Config::getLongPollingUrl() : \CPullOptions::GetListenSecureUrl(), 'WEBSOCKET_ENABLED' => $isSharedMode ? true : \CPullOptions::GetWebSocket(), 'WEBSOCKET' => $isSharedMode ? \Bitrix\Pull\SharedServer\Config::getWebSocketUrl() : \CPullOptions::GetWebSocketUrl(), 'WEBSOCKET_SECURE' => $isSharedMode ? \Bitrix\Pull\SharedServer\Config::getWebSocketUrl() : \CPullOptions::GetWebSocketSecureUrl(), 'PUBLISH_ENABLED' => $isSharedMode ? true : \CPullOptions::GetPublishWebEnabled(), 'PUBLISH' => $isSharedMode ? \Bitrix\Pull\SharedServer\Config::getWebPublishUrl() : \CPullOptions::GetPublishWebUrl(), 'PUBLISH_SECURE' => $isSharedMode ? \Bitrix\Pull\SharedServer\Config::getWebPublishUrl() : \CPullOptions::GetPublishWebSecureUrl(), 'CONFIG_TIMESTAMP' => \CPullOptions::GetConfigTimestamp(), ); foreach ($serverConfig as $key => $value) { if(is_string($value) && strpos($value, '#DOMAIN#') !== false) { $serverConfig[$key] = str_replace('#DOMAIN#', $domain, $value); } } $config['SERVER'] = $serverConfig; if($isSharedMode) { $config['CLIENT_ID'] = Client::getPublicLicenseCode(); } $config['API'] = Array( 'REVISION_WEB' => PULL_REVISION_WEB, 'REVISION_MOBILE' => PULL_REVISION_MOBILE, ); $config['CHANNELS'] = Array(); if ($sharedChannel) { $config['CHANNELS']['SHARED'] = Array( 'ID' => \CPullChannel::SignChannel($sharedChannel["CHANNEL_ID"]), 'START' => $sharedChannel['CHANNEL_DT'], 'END' => $sharedChannel['CHANNEL_DT']+\CPullChannel::CHANNEL_TTL, ); } if ($privateChannel) { if (\CPullOptions::GetQueueServerVersion() > 3) { $privateId = $privateChannel["CHANNEL_PUBLIC_ID"]? $privateChannel["CHANNEL_ID"].":".$privateChannel["CHANNEL_PUBLIC_ID"]: $privateChannel["CHANNEL_ID"]; $privateId = \CPullChannel::SignChannel($privateId); $publicId = \CPullChannel::SignPublicChannel($privateChannel["CHANNEL_PUBLIC_ID"]); } else { $privateId = \CPullChannel::SignChannel($privateChannel["CHANNEL_ID"]); $publicId = ''; } $config['CHANNELS']['PRIVATE'] = Array( 'ID' => $privateId, 'PUBLIC_ID' => $publicId, 'START' => $privateChannel['CHANNEL_DT'], 'END' => $privateChannel['CHANNEL_DT']+\CPullChannel::CHANNEL_TTL, ); } $config['PUBLIC_CHANNELS'] = \Bitrix\Pull\Channel::getPublicIds(['JSON' => (bool)$params['JSON']]); if ($params['JSON']) { $result['server'] = array_change_key_case($config['SERVER'], CASE_LOWER); $result['api'] = array_change_key_case($config['API'], CASE_LOWER); foreach ($config['CHANNELS'] as $type => $channel) { $type = strtolower($type); $result['channels'][$type] = array_change_key_case($channel, CASE_LOWER); $result['channels'][$type]['type'] = $type; $result['channels'][$type]['start'] = date('c', $channel['START']); $result['channels'][$type]['end'] = date('c', $channel['END']); } if($isSharedMode) { $result['clientId'] = $config['CLIENT_ID']; } $result['publicChannels'] = $config['PUBLIC_CHANNELS']; $config = $result; } return $config; } /** * @param string $channelId * @return bool|string|null */ public static function getPublishUrl($channelId = "") { $params = []; if(\CPullOptions::IsServerShared()) { $result = \Bitrix\Pull\SharedServer\Config::getPublishUrl(); $params["clientId"] = \Bitrix\Pull\SharedServer\Client::getPublicLicenseCode(); } else { $result = \CPullOptions::GetPublishUrl(); } if($channelId != "") { $params["CHANNEL_ID"] = $channelId; } return \CHTTP::urlAddParams($result, $params); } public static function getSignatureKey() { if(\CPullOptions::IsServerShared()) { return \Bitrix\Pull\SharedServer\Config::getSignatureKey(); } else { return \CPullOptions::GetSignatureKey(); } } public static function isProtobufUsed() { $result = \CPullOptions::IsServerShared() || ( \CPullOptions::GetQueueServerVersion() >= 4 && \CPullOptions::IsProtobufSupported() && \CPullOptions::IsProtobufEnabled() ); return $result; } }
/var/www/axolotl/data/www/msk.axolotls.ru/bitrix/modules/pull/lib/config.php