1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
bitrix24.php
См. документацию.
1<?php
2
4
5use Bitrix\Bitrix24\License\Market;
7use CBitrix24;
8
9final class Bitrix24
10{
11 private static Bitrix24 $instance;
12 private bool $available = false;
13
14 private function __construct()
15 {
16 $this->available = Loader::includeModule('bitrix24');
17 }
18
19 public static function getInstance()
20 {
21 if (!isset(static::$instance))
22 {
23 static::$instance = new static();
24 }
25 return static::$instance;
26 }
27
28 private function __clone() { }
29
30 public function isAvailable(): bool
31 {
32 return $this->available;
33 }
34
35 public function isAvailableForRuRegion(): bool
36 {
37 return $this->available && \Bitrix\Bitrix24\License::getCurrent()->getRegion() === 'ru';
38 }
39
40 public function getBuyPath(): ?string
41 {
42 if ($this->available)
43 {
44 return CBitrix24::isLicensePaid()? Market::getDefaultBuyPath() : Market::PATH_MARKET_BUT_WITHOUT_TARIFF;
45 }
46
47 return null;
48 }
49}
Определения loader.php:13