1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
proxyrequest.php
См. документацию.
1<?php
2
3namespace Bitrix\Seo\Retargeting;
4
5use Bitrix\Main\InvalidOperationException;
6use Bitrix\Seo\Engine;
7
8class ProxyRequest extends Request
9{
11
19 public function query(array $params = array())
20 {
21 if ($this->useDirectQuery)
22 {
23 return $this->directQuery($params);
24 }
25
26 $methodName = static::REST_METHOD_PREFIX . '.' . $params['methodName'];
27 $parameters = $params['parameters'];
28
30 if (!$engine->isRegistered())
31 {
32 return false;
33 }
34 $parameters['proxy_client_id'] = $this->getAuthAdapter()->getClientId();
35 $parameters['lang'] = LANGUAGE_ID;
36
37 if (!$engine->getInterface())
38 {
39 return false;
40 }
41
42 $transport = $engine->getInterface()->getTransport();
43 if (isset($params['timeout']))
44 {
45 $transport->setTimeout($params['timeout']);
46 }
47
48 if (isset($params['listenHttpErrors']) && $params['listenHttpErrors'])
49 {
50 $transport->listenHttpErrors();
51 }
52
53 if (isset($params['streamTimeout']))
54 {
55 $transport->setStreamTimeout((int)$params['streamTimeout']);
56 }
57
58 $response = $transport->call($methodName, $parameters);
59 if (isset($response['result']['RESULT']))
60 {
61 return $response['result']['RESULT'];
62 }
63
64 if (isset($response['error']))
65 {
66 throw new InvalidOperationException($response['error_description'] ? $response['error_description'] : $response['error']);
67 }
68 return [];
69 }
70
71 public function getServiceUrl(string $sourceUrl): string
72 {
73 $domains = [
74 'tech' => 'bitrix24.tech',
75 'info' => 'bitrix.info',
76 ];
77
78 $domain = \Bitrix\Main\Application::getInstance()->getLicense()->getRegion() == 'ru'
79 ? $domains['tech']
80 : $domains['info']
81 ;
82
83 return str_replace(
84 array_values($domains),
85 [$domain, $domain],
86 $sourceUrl,
87 );
88 }
89}
static getInstance()
Определения application.php:98
Определения request.php:10
getServiceUrl(string $sourceUrl)
Определения proxyrequest.php:71
query(array $params=array())
Определения proxyrequest.php:19
static getEngine(?Request $request=null)
Определения service.php:292
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения template.php:799
$response
Определения result.php:21
$engine
Определения options.php:121