1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
executer.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Sale\TradingPlatform\Vk\Api;
4
5
use Bitrix\Main\ArgumentNullException;
6
use Bitrix\Main\Web\Json;
7
use Bitrix\Main\IO;
8
9
10
class
Executer
11
{
12
private
$api;
13
private
$scriptPath;
14
15
public
function
__construct
($api)
16
{
17
if
(empty($api))
18
throw
new
ArgumentNullException
(
'api'
);
19
20
$this->scriptPath =
$_SERVER
[
'DOCUMENT_ROOT'
] .
"/bitrix/modules/sale/lib/tradingplatform/vk/api/scripts"
;
21
$this->api = $api;
22
}
23
24
31
private
function
getScript(
$name
)
32
{
33
$filePath = $this->scriptPath .
'/'
.
$name
.
'.vks'
;
34
if
(
IO
\File::isFileExists($filePath))
35
{
36
$script =
IO\File::getFileContents
($filePath);
37
// $script = file_get_contents($filePath);
38
39
return
$script;
40
}
41
42
return
NULL;
43
}
44
45
53
public
function
__call
($methodName, $arguments)
54
{
55
// prepare METHOD name
56
$methodName = mb_strtolower($methodName);
57
if
(mb_strpos($methodName,
'execute'
) == 0)
58
{
59
$methodName = str_replace(
"execute"
,
""
, $methodName);
60
}
61
62
$script = $this->getScript($methodName);
63
if
(
count
($arguments))
64
{
65
$script = $this->prepareParams($script, $arguments[0]);
66
}
67
$response
= $this->api->run(
'execute'
,
array
(
'code'
=> $script));
68
69
return
$response
;
70
}
71
72
81
private
function
prepareParams($script,
$params
)
82
{
83
foreach
(
$params
as
$key
=> $value)
84
{
85
if
(is_array($value))
86
{
87
$value = \CUtil::PhpToJSObject($value);
88
}
89
$script = str_replace(
'%'
.mb_strtoupper(
$key
) .
'%'
, $value, $script);
90
}
91
92
return
$script;
93
}
94
101
private
function
decodeMultibyteUnicode(
$str
)
102
{
103
$str
= preg_replace_callback(
'/\\\\u(\w{4})/'
,
function
(
$matches
)
104
{
105
return
html_entity_decode(
'&#x'
.
$matches
[1] .
';'
,
null
,
'UTF-8'
);
106
},
$str
);
107
108
return
$str
;
109
}
110
}
Bitrix\Main\ArgumentNullException
Определения
ArgumentNullException.php:9
Bitrix\Main\IO\File\getFileContents
static getFileContents($path)
Определения
file.php:255
Bitrix\Sale\TradingPlatform\Vk\Api\Executer
Определения
executer.php:11
Bitrix\Sale\TradingPlatform\Vk\Api\Executer\__call
__call($methodName, $arguments)
Определения
executer.php:53
Bitrix\Sale\TradingPlatform\Vk\Api\Executer\__construct
__construct($api)
Определения
executer.php:15
$str
$str
Определения
commerceml2.php:63
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$_SERVER
$_SERVER["DOCUMENT_ROOT"]
Определения
cron_frame.php:9
$name
$name
Определения
menu_edit.php:35
Bitrix\Main\IO
Определения
directory.php:3
$key
if(empty($signedUserToken)) $key
Определения
quickway.php:257
count
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"
Определения
waybill.php:936
$params
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения
template.php:799
$response
$response
Определения
result.php:21
$matches
$matches
Определения
index.php:22
bitrix
modules
sale
lib
tradingplatform
vk
api
executer.php
Создано системой
1.14.0