Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
config.php
1
<?php
2
3
namespace
Bitrix\Pull\SharedServer
;
4
5
use
Bitrix\Main\Config\Option
;
6
7
class
Config
8
{
9
const
DEFAULT_SERVER
=
"https://rtc-cloud.bitrix.info"
;
10
const
HOSTNAME_URL
=
"/hostname"
;
11
const
SERVER_LIST_URL
=
"/servers"
;
12
const
REGISTER_URL
=
"/register-client/"
;
13
const
PUB_URL
=
"/pub/"
;
14
const
SUB_URL
=
"/subws/"
;
15
const
REST_URL
=
"/rest/"
;
16
const
RPC_URL
=
"/api/"
;
17
18
const
SERVER_ADDRESS
=
'shared_server_address'
;
19
const
SHARED_SERVER_KEY
=
'shared_server_key'
;
20
const
IS_REGISTERED_ON_SHARED_SERVER
=
'registered_on_shared_server'
;
21
const
CLOUD_SERVER_VERSION
= 4;
22
23
public
static
function
getServerVersion
()
24
{
25
return
static::CLOUD_SERVER_VERSION;
26
}
27
28
public
static
function
getDefaultCloudServer
(): string
29
{
30
return
defined(
'PULL_CLOUD_SERVER'
) ? PULL_CLOUD_SERVER : static::DEFAULT_SERVER;
31
}
32
33
public
static
function
getServerAddress
()
34
{
35
return
Option::get(
"pull"
, static::SERVER_ADDRESS);
36
}
37
38
public
static
function
setServerAddress
($serverAddress)
39
{
40
Option::set(
"pull"
, static::SERVER_ADDRESS, $serverAddress);
41
}
42
43
public
static
function
getRegisterUrl
()
44
{
45
return
"https://"
. static::getServerAddress() . (defined(
"PULL_SHARED_REGISTER_URL"
) ? PULL_SHARED_REGISTER_URL : static::REGISTER_URL);
46
}
47
53
public
static
function
getPublishUrl
()
54
{
55
return
"https://"
. static::getServerAddress() . static::PUB_URL;
56
}
57
63
public
static
function
getJsonRpcUrl
()
64
{
65
return
"https://"
. static::getServerAddress() . static::RPC_URL;
66
}
67
73
public
static
function
getLongPollingUrl
()
74
{
75
return
"https://"
. static::getServerAddress() . static::SUB_URL;
76
}
77
83
public
static
function
getWebSocketUrl
()
84
{
85
$result =
"wss://"
. static::getServerAddress() . static::SUB_URL;
86
return
$result;
87
}
88
92
public
static
function
getWebPublishUrl
()
93
{
94
return
"https://"
. static::getServerAddress() . static::REST_URL;
95
}
96
97
public
static
function
setSignatureKey
($signatureKey)
98
{
99
Option::set(
"pull"
, static::SHARED_SERVER_KEY, $signatureKey);
100
}
101
102
public
static
function
getSignatureKey
()
103
{
104
return
Option::get(
"pull"
, static::SHARED_SERVER_KEY);
105
}
106
107
public
static
function
setRegistered
($isRegistered)
108
{
109
Option::set(
"pull"
, static::IS_REGISTERED_ON_SHARED_SERVER, ($isRegistered ?
"Y"
:
"N"
));
110
}
111
112
public
static
function
isRegistered
()
113
{
114
return
(Option::get(
"pull"
, static::IS_REGISTERED_ON_SHARED_SERVER) ===
"Y"
);
115
}
116
}
Bitrix\Main\Config\Option
Definition
option.php:15
Bitrix\Pull\SharedServer\Config\SHARED_SERVER_KEY
const SHARED_SERVER_KEY
Definition
config.php:19
Bitrix\Pull\SharedServer\Config\getWebPublishUrl
static getWebPublishUrl()
Definition
config.php:92
Bitrix\Pull\SharedServer\Config\getServerAddress
static getServerAddress()
Definition
config.php:33
Bitrix\Pull\SharedServer\Config\setSignatureKey
static setSignatureKey($signatureKey)
Definition
config.php:97
Bitrix\Pull\SharedServer\Config\HOSTNAME_URL
const HOSTNAME_URL
Definition
config.php:10
Bitrix\Pull\SharedServer\Config\setServerAddress
static setServerAddress($serverAddress)
Definition
config.php:38
Bitrix\Pull\SharedServer\Config\isRegistered
static isRegistered()
Definition
config.php:112
Bitrix\Pull\SharedServer\Config\PUB_URL
const PUB_URL
Definition
config.php:13
Bitrix\Pull\SharedServer\Config\getDefaultCloudServer
static getDefaultCloudServer()
Definition
config.php:28
Bitrix\Pull\SharedServer\Config\REGISTER_URL
const REGISTER_URL
Definition
config.php:12
Bitrix\Pull\SharedServer\Config\REST_URL
const REST_URL
Definition
config.php:15
Bitrix\Pull\SharedServer\Config\SUB_URL
const SUB_URL
Definition
config.php:14
Bitrix\Pull\SharedServer\Config\setRegistered
static setRegistered($isRegistered)
Definition
config.php:107
Bitrix\Pull\SharedServer\Config\CLOUD_SERVER_VERSION
const CLOUD_SERVER_VERSION
Definition
config.php:21
Bitrix\Pull\SharedServer\Config\RPC_URL
const RPC_URL
Definition
config.php:16
Bitrix\Pull\SharedServer\Config\SERVER_ADDRESS
const SERVER_ADDRESS
Definition
config.php:18
Bitrix\Pull\SharedServer\Config\getRegisterUrl
static getRegisterUrl()
Definition
config.php:43
Bitrix\Pull\SharedServer\Config\DEFAULT_SERVER
const DEFAULT_SERVER
Definition
config.php:9
Bitrix\Pull\SharedServer\Config\IS_REGISTERED_ON_SHARED_SERVER
const IS_REGISTERED_ON_SHARED_SERVER
Definition
config.php:20
Bitrix\Pull\SharedServer\Config\SERVER_LIST_URL
const SERVER_LIST_URL
Definition
config.php:11
Bitrix\Pull\SharedServer\Config\getLongPollingUrl
static getLongPollingUrl()
Definition
config.php:73
Bitrix\Pull\SharedServer\Config\getPublishUrl
static getPublishUrl()
Definition
config.php:53
Bitrix\Pull\SharedServer\Config\getJsonRpcUrl
static getJsonRpcUrl()
Definition
config.php:63
Bitrix\Pull\SharedServer\Config\getSignatureKey
static getSignatureKey()
Definition
config.php:102
Bitrix\Pull\SharedServer\Config\getWebSocketUrl
static getWebSocketUrl()
Definition
config.php:83
Bitrix\Pull\SharedServer\Config\getServerVersion
static getServerVersion()
Definition
config.php:23
Bitrix\Main\Config
Definition
configuration.php:2
Bitrix\Pull\SharedServer
Definition
client.php:3
modules
pull
lib
sharedserver
config.php
Создано системой
1.10.0