Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
bitrix.php
1
<?php
9
namespace
Bitrix\Seo\Engine
;
10
11
use
Bitrix\Main\Loader
;
12
use
Bitrix\Seo\Engine
;
13
use
Bitrix\Seo\IEngine
;
14
15
if
(!defined(
"BITRIX_CLOUD_ADV_URL"
))
16
{
17
define(
"BITRIX_CLOUD_ADV_URL"
,
'https://cloud-adv.bitrix.info'
);
18
}
19
20
if
(!defined(
"SEO_BITRIX_API_URL"
))
21
{
22
define(
"SEO_BITRIX_API_URL"
, BITRIX_CLOUD_ADV_URL.
"/rest/"
);
23
}
24
25
class
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
{
51
return
$this->engineRegistered
;
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
64
return
$this->authInterface
;
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
}
Bitrix\Main\Loader
Definition
loader.php:12
Bitrix\Seo\Engine\Bitrix\__construct
__construct()
Definition
bitrix.php:34
Bitrix\Seo\Engine\Bitrix\getInterface
getInterface()
Definition
bitrix.php:54
Bitrix\Seo\Engine\Bitrix\isRegistered
isRegistered()
Definition
bitrix.php:49
Bitrix\Seo\Engine\Bitrix\API_URL
CONST API_URL
Definition
bitrix.php:32
Bitrix\Seo\Engine\Bitrix\setAuthSettings
setAuthSettings($settings=null)
Definition
bitrix.php:67
Bitrix\Seo\Engine\Bitrix\$engineRegistered
$engineRegistered
Definition
bitrix.php:30
Bitrix\Seo\Engine\Bitrix\$engineId
$engineId
Definition
bitrix.php:29
Bitrix\Seo\Engine\Bitrix\ENGINE_ID
const ENGINE_ID
Definition
bitrix.php:27
Bitrix\Seo\Engine
Definition
engine.php:14
Bitrix\Seo\Engine\saveSettings
saveSettings()
Definition
engine.php:83
Bitrix\Seo\Engine\$authInterface
$authInterface
Definition
engine.php:25
Bitrix\Seo\IEngine
Definition
iengine.php:11
Bitrix\Seo\Engine
Definition
bitrix.php:9
Bitrix
modules
seo
lib
engine
bitrix.php
Создано системой
1.10.0