1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
engine.php
См. документацию.
1<?
8namespace Bitrix\Seo;
9
10use Bitrix\Main\SystemException;
11use Bitrix\Seo\SearchEngineTable;
12
13class Engine
14{
15 const HTTP_STATUS_OK = 200;
19
20 protected $engineId = 'unknown engine';
21
22 protected $engine = null;
23 protected $engineSettings = array();
24
25 protected $authInterface = null;
26
27 public function __construct()
28 {
29 if(!$this->engine)
30 {
31 $this->engine = static::getEngine($this->engineId);
32 }
33
34 if(!is_array($this->engine))
35 {
36 throw new SystemException("Unknown search engine");
37 }
38 else
39 {
40 if($this->engine['SETTINGS'] <> '')
41 {
42 $this->engineSettings = unserialize($this->engine['SETTINGS'], ['allowed_classes' => false]);
43 }
44 }
45 }
46
47 public function getId()
48 {
49 return $this->engine['ID'];
50 }
51
52 public function getCode()
53 {
54 return $this->engine['CODE'];
55 }
56
57 public function getSettings()
58 {
59 return $this->engineSettings;
60 }
61
62 public function getClientId()
63 {
64 return $this->engine['CLIENT_ID'];
65 }
66
67 public function getClientSecret()
68 {
69 return $this->engine['CLIENT_SECRET'];
70 }
71
72 public function getAuthSettings()
73 {
74 return ($this->engineSettings['AUTH'] ?? false);
75 }
76
77 public function clearAuthSettings()
78 {
79 unset($this->engineSettings['AUTH']);
80 $this->saveSettings();
81 }
82
83 protected function saveSettings()
84 {
85 SearchEngineTable::update($this->engine['ID'], array(
86 'SETTINGS' => serialize($this->engineSettings)
87 ));
88 }
89
90 protected static function getEngine($engineId)
91 {
93 return $dbEngine->fetch();
94 }
95}
96
__construct()
Определения engine.php:27
getId()
Определения engine.php:47
const HTTP_STATUS_OK
Определения engine.php:15
getClientSecret()
Определения engine.php:67
static getEngine($engineId)
Определения engine.php:90
$engine
Определения engine.php:22
$engineSettings
Определения engine.php:23
saveSettings()
Определения engine.php:83
$engineId
Определения engine.php:20
getClientId()
Определения engine.php:62
getCode()
Определения engine.php:52
clearAuthSettings()
Определения engine.php:77
const HTTP_STATUS_CREATED
Определения engine.php:16
$authInterface
Определения engine.php:25
const HTTP_STATUS_AUTHORIZATION
Определения engine.php:18
getAuthSettings()
Определения engine.php:72
getSettings()
Определения engine.php:57
const HTTP_STATUS_NO_CONTENT
Определения engine.php:17
static getByCode($code)
Определения searchengine.php:82
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
Определения action.php:3