Download the PHP package remessage/message without Composer
On this page you can find all versions of the php package remessage/message. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download remessage/message
More information about remessage/message
Files in remessage/message
Package message
Short Description Message Standard for networking in Re: Message.
License Apache-2.0
Homepage https://dev.remessage.ru/packages/message
Informations about the package message
Message Standard
This package defines the rules and formats for communication between clients and servers that are part of Re: Message.
Standard based on JSON format and created to implement a JSON-pure API. This package uses the symfony/serializer
for encoding and decoding JSON.
The remessage/client
and remessage/core
based on this standard.
Requirements
PHP 8.2+ with these extensions:
- json
- mbstring
Installation
You will need Composer to install:
composer require remessage/message
Description
Message is any data sent as part of the server-client interaction. Any message MUST have a type
high level property with the message type (see Types).
Transport
As a data transmission channel, HTTP or sockets can be used. See Core documentation for details.
When using the HTTP protocol, only action, response, error messages can be used.
Types
There are several types of messages for communication. The main types of messages: action, response and error. These types of messages can be sent and received via any transport.
Action
The Action message is a message, which is a request to perform some action and return its results as a Response. Action can be sent only from a client side.
Any action message MUST have a name
and a parameters
properties. The name
property contains a name of action (e.g. auth.sendCode
). The parameters
property is a list of parameters for action.
Also, Action message can have these optional properties:
id
property: a random identifier for the Action message which MUST be returned in the Response message if the identifier was senttoken
property: access token to this action (you can pass the token in other ways)
Example:
Response
The Response message is a message returned as the result of the Action if the action completed successfully. A message of this type MUST have a content
property, that contains the results of action. Response can be sent only by the Core.
Also, Response message can have these optional properties:
id
property: an identifier from the Action message if the identifier was sent
Example:
Error
The Error message is the message returned if an error occurred while performing an action. The error message MUST have a code
and message
properties. The code
property is a number code of error. The message
property is a short description about error. A complete list of errors that may be thrown is available here. Error can be sent only by the Core.
Example:
All versions of message with dependencies
ext-mbstring Version *
doctrine/collections Version ^1.6 || ^2.0
symfony/serializer Version ^6.2 || ^7.0
symfony/deprecation-contracts Version ^3.2
symfony/polyfill-php83 Version ^1.28