Download the PHP package magna-cms/message-lite without Composer

On this page you can find all versions of the php package magna-cms/message-lite. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package message-lite

Message Lite

Message Lite is a Magna CMS plugin that provides plain text conversations between people, for any Magna plugin that needs them.

Standalone: no requires in the manifest, and no dependency on any other plugin. It ships no admin screens or front end of its own (attachments are only counted in the media library's storage figures) — it is a building block: a PHP service API for host plugins, plus a JSON API for your front end.

The one idea

Message Lite does not know what a conversation is about. A thread carries an opaque context_type / context_id, so one host points it at a service request and the next points it at an order, a ticket, or nothing at all — without either of them teaching this schema what those words mean.

Everything else follows from that:

What it does

Threads opened by the host, optionally about a context, optionally with a subject
Participants many per thread, each with the host's own word for their role
Messages plain text, with replies, edits and withdrawal
Read state last_read_at per participant, one query for the unread badge and one for the per-thread breakdown
Thread lists previewsFor() — the last message in each of a page of threads, in one query
Attachments files on a message, on a private disk with no public URL, streamed by an authorised endpoint
Muting silence a thread without leaving it
Delivery polling, cursor-based

Not included, deliberately: reactions, starring, pinning, typing indicators, disappearing messages. This is the lite one.

Requirements

Installation

From the root of your Magna CMS installation:

You can also enable it from the admin panel's Plugins screen instead of the second command. Enabling runs the plugin's migrations, which create the message_lite_conversations, message_lite_participants, message_lite_messages and message_lite_attachments tables.

Attachment limits (disk, size cap, files per message, allowed types) come from the plugin's config/message-lite.php; a config/message-lite.php in your Magna app overrides them.

Using it from a host plugin

Require it in your manifest:

Open a thread when something happens — never on request:

For a thread with a context, opening is idempotent on the context and the exact set of people, so a second offer on the same requirement continues the same conversation. Two different providers answering the same requirement get two threads — folding them together would put a client's reply to one in front of the other.

Richer rules

Bind your own participation rules in your plugin's register():

mayRead and mayWrite are asked separately because they genuinely come apart: an overseer reads without writing, and a finished thread is readable by everyone in it and writable by nobody.

Nothing is bound by default beyond ParticipationOnly, which is the strict answer rather than the convenient one — a permissive default would make "we forgot to configure it" and "we meant everyone to read this" look identical from the outside.

API

Served at /api/v1/message-lite, authenticated with a Magna API key sent as a bearer token (Authorization: Bearer …). The routes require a management-scope key; a delivery key is refused. Each request acts as the user who owns the key.

Reads are cursor-based: after asks "what has happened since I last looked", which is one indexed query, where "page one again" is the whole thread every few seconds.

Decisions worth knowing about

Checks

The checks run from a Magna CMS checkout with this plugin at plugins-dev/magna-cms/message-lite.

14 feature tests cover the things that would be expensive to get wrong: thread identity, the unread count, the polling cursor including the shared-second case, participation refusals, a closed thread staying readable, withdrawal leaving replies intact, cross-thread replies, and the absence of a create-conversation endpoint.

License

Message Lite is open-source software released under the MIT License, as declared in composer.json and magna.json.


All versions of message-lite with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
magna-cms/plugin-sdk Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package magna-cms/message-lite contains the following files

Loading the files please wait ...