4use Bitrix\Main\ArgumentException;
5use Bitrix\Main\ArgumentOutOfRangeException;
6use \Bitrix\Main\Localization\Loc;
7Loc::loadMessages(__FILE__);
25 throw new \Bitrix\Main\ArgumentNullException(
"actionId");
51 array $userParams = [],
52 array $freeParams = [],
57 throw new \Bitrix\Main\ArgumentNullException(
"actionId");
59 if(!is_array($userParams))
60 throw new \Bitrix\Main\ArgumentTypeException(
"userParams",
"array");
62 if(!is_array($userParams))
63 throw new \Bitrix\Main\ArgumentTypeException(
"freeParams",
"array");
66 throw new \Bitrix\Main\ArgumentTypeException(
"actionParams",
"array");
74 throw new \Exception(
"Can't find params of action ".$actionId);
93 $execRes = $shellAdapter->syncExec(
"sudo -u root /opt/webdir/bin/bx-process -a status -t ".$bid.
" -o json");
94 $data = $shellAdapter->getLastOutput();
98 $arData = json_decode(
$data,
true);
100 if(isset($arData[
"params"][$bid]))
102 $result = $arData[
"params"][$bid];
105 if(
$result[
"status"] ===
"finished")
109 "SCALE_ACTION_CHECK_STATE",
111 Loc::getMessage(
"SCALE_ACTIONSDATA_ACTION_FINISHED")
118 "SCALE_ACTION_CHECK_STATE",
120 Loc::getMessage(
"SCALE_ACTIONSDATA_ACTION_ERROR")
139 public static function getList($checkConditions =
false)
146 $file = new \Bitrix\Main\IO\File(
$filename);
149 if($file->isExists())
152 throw new \Bitrix\Main\IO\FileNotFoundException(
$filename);
158 if(is_array(
$def) && $checkConditions)
162 if(isset(
$action[
"CONDITION"]) && !self::isConditionSatisfied(
$action[
"CONDITION"]))
164 unset(
$def[$actionId]);
169 if(getenv(
'BITRIX_ENV_TYPE') ===
'crm')
172 $def[
'MONITORING_ENABLE'],
174 $def[
'SITE_CREATE_LINK'],
175 $def[
'SITE_CREATE_KERNEL'],
177 $def[
'MEMCACHED_ADD_ROLE'],
178 $def[
'MEMCACHED_DEL_ROLE'],
179 $def[
'SPHINX_ADD_ROLE'],
180 $def[
'PUSH_DEL_ROLE']
201 if(!isset($condition[
"COMMAND"], $condition[
"PARAMS"]) || !is_array($condition[
"PARAMS"]))
206 if(!isset($condition[
"PARAMS"][0], $condition[
"PARAMS"][1], $condition[
"PARAMS"][2]))
211 $actRes = static::getConditionActionResult($condition[
"COMMAND"]);
213 if(isset($actRes[
"condition"][
"OUTPUT"][
"DATA"][
"params"]))
215 $conditionValue = static::extractConditionValue(
216 $condition[
"PARAMS"][0],
217 $actRes[
"condition"][
"OUTPUT"][
"DATA"][
"params"]
222 $result = static::checkCondition(
224 $condition[
"PARAMS"][1],
225 $condition[
"PARAMS"][2]
241 $params = explode(
":", $paramName);
267 "START_COMMAND_TEMPLATE" => $command,
277 catch(\Exception $excpt)
291 protected static function checkCondition(
string $operand1,
string $operator,
string $operand2): bool
293 $allowedOperators = [
'==='];
295 if(!in_array($operator, $allowedOperators))
300 $allowedOperandRegex =
'/^[0-9a-zA-Z_:\-\'\"]+$/i';
302 if(!preg_match($allowedOperandRegex, $operand1))
307 if(!preg_match($allowedOperandRegex, $operand2))
312 return eval(
"return ('{$operand1}' {$operator} '{$operand2}');");
333 $execRes = $shellAdapter->syncExec(
"sudo -u root /opt/webdir/bin/bx-process -a list -o json");
334 $data = $shellAdapter->getLastOutput();
338 $arData = json_decode(
$data,
true);
341 if(isset($arData[
"params"]) && is_array($arData[
"params"]))
345 if(mb_strpos($bid,
'common_') === 0)
static getActionState($bid)
static checkCondition(string $operand1, string $operator, string $operand2)
static getActionObject( $actionId, $serverHostname="", array $userParams=[], array $freeParams=[], array $actionParams=[])
static extractConditionValue(string $paramName, array $paramsValues)
static setLogLevel($logLevel)
static isConditionSatisfied($condition)
static getConditionActionResult(string $command)
static getAction($actionId)
static getList($checkConditions=false)
static checkRunningAction()
static addRecord($level, $auditType, $itemId, $description)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
</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."%"
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
foreach($arTemplatesList as $templ) if(mb_strpos($templ["NAME"] $def