芝麻web文件管理V1.00
编辑当前文件:/home/mgatv524/public_html/avenida/views/XMR.zip
PK GqYvu@ @ RekeyAction.phpnu [ action = 'rekeyAction'; return $this->serializeToJson(); } }PK GqYM{S S OverlayLayoutAction.phpnu [ layoutId = $layoutId; $this->duration = $duration; $this->downloadRequired = $downloadRequired; return $this; } /** * @inheritdoc */ public function getMessage() { $this->action = 'overlayLayout'; if ($this->layoutId == 0) throw new PlayerActionException(__('Layout Details not provided')); if ($this->duration == 0) throw new PlayerActionException(__('Duration not provided')); return $this->serializeToJson(['layoutId', 'duration', 'downloadRequired']); } }PK GqY PlayerActionInterface.phpnu [ setQos(1); $this->action = 'collectNow'; return $this->serializeToJson(); } }PK GqYL L ChangeLayoutAction.phpnu [ layoutId = $layoutId; $this->duration = $duration; $this->downloadRequired = $downloadRequired; $this->changeMode = $changeMode; return $this; } public function getMessage() { $this->action = 'changeLayout'; if ($this->layoutId == 0) throw new PlayerActionException('Layout Details not provided'); return $this->serializeToJson(['layoutId', 'duration', 'downloadRequired', 'changeMode']); } }PK GqY. CommandAction.phpnu [ commandCode = $code; return $this; } public function getMessage() { $this->action = 'commandAction'; if ($this->commandCode == '') throw new PlayerActionException('Missing Command Code'); return $this->serializeToJson(['commandCode']); } }PK GqY:< < PlayerAction.phpnu [ channel = $channel; if (!$this->publicKey = openssl_get_publickey($key)) throw new PlayerActionException('Invalid Public Key'); return $this; } /** * Set the message TTL * @param int $ttl * @return $this */ public final function setTtl($ttl = 120) { $this->ttl = $ttl; return $this; } /** * Set the message QOS * @param int $qos * @return $this */ public final function setQos($qos = 10) { $this->qos = $qos; return $this; } /** * Serialize this object to its JSON representation * @param array $include * @return string */ public final function serializeToJson($include = []) { $include = array_merge(['action', 'createdDt', 'ttl'], $include); $json = []; foreach (get_object_vars($this) as $key => $value) { if (in_array($key, $include)) { $json[$key] = $value; } } return json_encode($json); } /** * Return the encrypted message and keys * @return array * @throws PlayerActionException */ public final function getEncryptedMessage() { $message = null; if (!openssl_seal($this->getMessage(), $message, $eKeys, [$this->publicKey])) throw new PlayerActionException('Cannot seal message'); return [ 'key' => base64_encode($eKeys[0]), 'message' => base64_encode($message) ]; } /** * Send the action to the specified connection and wait for a reply (acknowledgement) * @param string $connection * @return string * @throws PlayerActionException */ public final function send($connection) { try { // Set the message create date $this->createdDt = date('c'); // Set the TTL if not already set if ($this->ttl == 0) $this->setTtl(); // Set the QOS if not already set if ($this->qos === null) $this->setQos(); // Get the encrypted message $encrypted = $this->getEncryptedMessage(); // Envelope our message $message = [ 'channel' => $this->channel, 'message' => $encrypted['message'], 'key' => $encrypted['key'], 'qos' => $this->qos ]; // Issue a message payload to XMR. $context = new \ZMQContext(); // Connect to socket $socket = new \ZMQSocket($context, \ZMQ::SOCKET_REQ); $socket->setSockOpt(\ZMQ::SOCKOPT_LINGER, 2000); $socket->connect($connection); // Send the message to the socket $socket->send(json_encode($message)); // Need to replace this with a non-blocking recv() with a retry loop $retries = 15; $reply = false; do { try { // Try and receive // if ZMQ::MODE_NOBLOCK/MODE_DONTWAIT is used and the operation would block boolean false // shall be returned. $reply = $socket->recv(\ZMQ::MODE_DONTWAIT); if ($reply !== false) break; } catch (\ZMQSocketException $sockEx) { if ($sockEx->getCode() !== \ZMQ::ERR_EAGAIN) throw $sockEx; } usleep(100000); } while (--$retries); // Disconnect socket $socket->disconnect($connection); // Return the reply, if we couldn't connect then the reply will be false return $reply; } catch (\ZMQSocketException $ex) { throw new PlayerActionException('XMR connection failed. Error = ' . $ex->getMessage()); } } }PK GqY &R, , LicenceCheckAction.phpnu [ . */ namespace Xibo\XMR; /** * Class LicenceCheckAction * @package Xibo\XMR */ class LicenceCheckAction extends PlayerAction { /** * @return mixed|string */ public function getMessage() { $this->action = 'licenceCheck'; return $this->serializeToJson(); } }PK GqYĸ ClearStatsAndLogsAction.phpnu [ action = 'clearStatsAndLogs'; return $this->serializeToJson(); } }PK GqY^O O RevertToSchedule.phpnu [ action = 'revertToSchedule'; return $this->serializeToJson(); } }PK GqY [I I ScreenShotAction.phpnu [ action = 'screenShot'; return $this->serializeToJson(); } }PK GqYvu@ @ RekeyAction.phpnu [ PK GqYM{S S OverlayLayoutAction.phpnu [ PK GqY PlayerActionInterface.phpnu [ PK GqY;- k PlayerActionException.phpnu [ PK GqYі CollectNowAction.phpnu [ PK GqYL L ChangeLayoutAction.phpnu [ PK GqY. CommandAction.phpnu [ PK GqY:< < PlayerAction.phpnu [ PK GqY &R, , ( LicenceCheckAction.phpnu [ PK GqYĸ , ClearStatsAndLogsAction.phpnu [ PK GqY^O O . RevertToSchedule.phpnu [ PK GqY [I I n0 ScreenShotAction.phpnu [ PK 1