Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
bitrix.php
1<?php
10
14
15if(!defined("BITRIX_CLOUD_ADV_URL"))
16{
17 define("BITRIX_CLOUD_ADV_URL", 'https://cloud-adv.bitrix.info');
18}
19
20if(!defined("SEO_BITRIX_API_URL"))
21{
22 define("SEO_BITRIX_API_URL", BITRIX_CLOUD_ADV_URL."/rest/");
23}
24
25class Bitrix extends Engine implements IEngine
26{
27 const ENGINE_ID = 'bitrix';
28
29 protected $engineId = 'bitrix';
30 protected $engineRegistered = false;
31
32 CONST API_URL = SEO_BITRIX_API_URL;
33
34 public function __construct()
35 {
36 $this->engine = static::getEngine($this->engineId);
37 if($this->engine)
38 {
39 $this->engineRegistered = true;
40 parent::__construct();
41 }
42 }
43
49 public function isRegistered()
50 {
52 }
53
54 public function getInterface()
55 {
56 if($this->authInterface === null)
57 {
58 if(Loader::includeModule('socialservices'))
59 {
60 $this->authInterface = new \CBitrixSeoOAuthInterface($this->engine['CLIENT_ID'], $this->engine['CLIENT_SECRET']);
61 }
62 }
63
65 }
66
67 public function setAuthSettings($settings = null)
68 {
69 if(is_array($settings) && array_key_exists("expires_in" ,$settings))
70 {
71 $settings["expires_in"] += time();
72 }
73
74 $this->engineSettings['AUTH'] = $settings;
75 $this->saveSettings();
76 }
77}
setAuthSettings($settings=null)
Definition bitrix.php:67