1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
Registrar.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\MessageService\Providers\Base;
4
5
use Bitrix\Main\Context;
6
use Bitrix\Main\Result;
7
use Bitrix\MessageService\Providers;
8
9
abstract
class
Registrar
implements
Providers\Registrar
10
{
11
protected
Providers\OptionManager
$optionManager
;
12
protected
string
$providerId
;
13
14
public
function
__construct
(
string
$providerId
,
Providers
\
OptionManager
$optionManager
)
15
{
16
$this->providerId =
$providerId
;
17
$this->optionManager =
$optionManager
;
18
}
19
20
public
function
isConfirmed
(): bool
21
{
22
return
$this->
isRegistered
();
23
}
24
25
public
function
confirmRegistration
(
array
$fields
):
Result
26
{
27
return
new
Result
();
28
}
29
30
public
function
sendConfirmationCode
():
Result
31
{
32
return
new
Result
();
33
}
34
35
public
function
sync
():
Registrar
36
{
37
return
$this;
38
}
39
40
public
function
getCallbackUrl
(): string
41
{
42
return
$this->
getHostUrl
() .
'/bitrix/tools/messageservice/callback_'
. $this->providerId .
'.php'
;
43
}
44
45
public
function
getHostUrl
(): string
46
{
47
$protocol
= (Context::getCurrent()->getRequest()->isHttps() ?
'https'
:
'http'
);
48
if
(defined(
"SITE_SERVER_NAME"
) && SITE_SERVER_NAME)
49
{
50
$host
= SITE_SERVER_NAME;
51
}
52
else
53
{
54
$host
=
55
\Bitrix\Main\Config\Option::get
(
'main'
,
'server_name'
, Context::getCurrent()->getServer()->getHttpHost())
56
?: Context::getCurrent()->getServer()->getHttpHost()
57
;
58
}
59
60
$port = Context::getCurrent()->getServer()->getServerPort();
61
if
($port != 80 && $port != 443 && $port > 0 && mb_strpos(
$host
,
':'
) ===
false
)
62
{
63
$host
.=
':'
.$port;
64
}
65
elseif
(
$protocol
===
'http'
&& $port == 80)
66
{
67
$host
= str_replace(
':80'
,
''
,
$host
);
68
}
69
elseif
(
$protocol
===
'https'
&& $port == 443)
70
{
71
$host
= str_replace(
':443'
,
''
,
$host
);
72
}
73
74
return
$protocol
.
'://'
.
$host
;
75
}
76
77
78
}
Bitrix\Main\Config\Option\get
static get($moduleId, $name, $default="", $siteId=false)
Определения
option.php:30
Bitrix\Main\DB\Result
Определения
result.php:20
Bitrix\MessageService\Providers\Base\Registrar
Определения
Registrar.php:10
Bitrix\MessageService\Providers\Base\Registrar\getCallbackUrl
getCallbackUrl()
Определения
Registrar.php:40
Bitrix\MessageService\Providers\Base\Registrar\$optionManager
Providers OptionManager $optionManager
Определения
Registrar.php:11
Bitrix\MessageService\Providers\Base\Registrar\confirmRegistration
confirmRegistration(array $fields)
Определения
Registrar.php:25
Bitrix\MessageService\Providers\Base\Registrar\__construct
__construct(string $providerId, Providers\OptionManager $optionManager)
Определения
Registrar.php:14
Bitrix\MessageService\Providers\Base\Registrar\isConfirmed
isConfirmed()
Определения
Registrar.php:20
Bitrix\MessageService\Providers\Base\Registrar\sync
sync()
Определения
Registrar.php:35
Bitrix\MessageService\Providers\Base\Registrar\$providerId
string $providerId
Определения
Registrar.php:12
Bitrix\MessageService\Providers\Base\Registrar\getHostUrl
getHostUrl()
Определения
Registrar.php:45
Bitrix\MessageService\Providers\Base\Registrar\sendConfirmationCode
sendConfirmationCode()
Определения
Registrar.php:30
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$protocol
$protocol
Определения
.description.php:9
Bitrix\MessageService\Providers\OptionManager
Определения
OptionManager.php:5
Bitrix\MessageService\Providers\Registrar
Определения
Registrar.php:7
Bitrix\MessageService\Providers\Registrar\isRegistered
isRegistered()
Bitrix\Main\$host
$host
Определения
mysql_to_pgsql.php:32
Bitrix\MessageService\Providers
elseif
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения
prolog_main_admin.php:393
$fields
$fields
Определения
yandex_run.php:501
bitrix
modules
messageservice
lib
Providers
Base
Registrar.php
Создано системой
1.14.0