1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
Registrar.php
См. документацию.
1<?php
2
3namespace Bitrix\MessageService\Providers\Base;
4
5use Bitrix\Main\Context;
6use Bitrix\Main\Result;
7use Bitrix\MessageService\Providers;
8
9abstract class Registrar implements Providers\Registrar
10{
12 protected string $providerId;
13
15 {
16 $this->providerId = $providerId;
17 $this->optionManager = $optionManager;
18 }
19
20 public function isConfirmed(): bool
21 {
22 return $this->isRegistered();
23 }
24
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}
static get($moduleId, $name, $default="", $siteId=false)
Определения option.php:30
Определения result.php:20
Providers OptionManager $optionManager
Определения Registrar.php:11
confirmRegistration(array $fields)
Определения Registrar.php:25
__construct(string $providerId, Providers\OptionManager $optionManager)
Определения Registrar.php:14
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$protocol
Определения .description.php:9
$host
Определения mysql_to_pgsql.php:32
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения prolog_main_admin.php:393
$fields
Определения yandex_run.php:501