Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/rest/lib/ |
Upload File : |
<?php namespace Bitrix\Rest; use Bitrix\Bitrix24\CurrentUser; use Bitrix\Main\Loader; use Bitrix\Main\LoaderException; use Bitrix\Pull\Event; class PullTransport implements MessageTransportInterface { /** * Users who receive messages * @var array user id */ private array $recipients; private string $moduleId; private int $expiry; /** * @throws LoaderException * @throws \Exception */ public function __construct(array $userIds = null, int $expiry = 0) { if (!Loader::includeModule('pull')) { throw new \Exception('Module "pull" not installed'); } if (is_null($userIds)) { $this->recipients = [CurrentUser::get()->getId()]; } else { $this->recipients = $userIds; } $this->moduleId = 'rest'; $this->expiry = $expiry; } public function send(string $method, array $parameters): bool { return Event::add($this->recipients, [ 'module_id' => $this->moduleId, 'command' => $method, 'params' => $parameters, 'expiry' => $this->expiry, ] ); } }