Download the PHP package ssch/t3-messenger without Composer

On this page you can find all versions of the php package ssch/t3-messenger. 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 t3-messenger

TYPO3 Symfony messenger adapter

Integrates Symfony Messenger into TYPO3 https://symfony.com/doc/current/components/messenger.html

Credits

Many thanks to Constructiva Solutions GmbH that sponsored the development of this extension with a sponsorship and a lot of valuable feedback.

Integration guide

The extension basically provides the same functionality as if you would use the messenger in the Symfony Framework. In order to configure the messenger you have to put a Messenger.php file under the Configuration folder of an extension.

Extbase Entities in Messages

If you need to pass an Extbase entity in a message, it's better to pass the entity's primary key (or whatever relevant information the handler actually needs, like email, etc.) instead of the object.

Have a look at the Symfony Documentation about Doctrine Entities

Transport Configuration

Messenger supports a number of different transport types, each with their own options. Options can be passed to the transport via a DSN string or configuration.

Have a look at the Symfony Documentation about Transports

Custom Doctrine Transport

The extension ships the doctrine transport with a slightly modified configuration DSN. Instead of using doctrine:// you have to use typo3-db://.

The format is typo3-db://, in case you have multiple connections and want to use one other than the "Default". The transport will automatically create a table named messenger_messages.

Please have a look for further configuration details at the doctrine transport.

Null Transport

The extension ships also with a NullTransport. This is useful if you want some messages in some instances not to be handled at all.

Middleware

Have a look at the Symfony Documentation about Middleware to understand the concept behind it.

The extension ships with a ValidationMiddleware for the extbase Validators. If you want to validate your commands add the middleware the following way in your Messenger.php:

Note: The id validation is a shortcut for the service id messenger.middleware.validation.

Additionally, the extension ships with a LoggingMiddleware for debugging purposes.

Async Mailer

The extension ships with a custom MessengerMailer which implements MailerInterface from TYPO3 core in order to send emails asynchronously if it is desired. Even if you are using TYPO3 10 you can already use the new MailerInterface. Inject the MailerInterface wherever you want:

If you are sending emails this way, nothing should change. The mails will be sent the way before via the MessengerBus. You could also inject the MailerInterface from Symfony Mailer and you will get the MessengerMailer injected.

If you truly want to send emails asynchronously you have to configure the routing section in your Messenger.php

Nothing comes for free. There are some caveats to tackle if you are sending emails asynchronously. Also have a look at the Symfony Documentation Sending Messages Async.

Note: Be aware that you should inject either the \TYPO3\CMS\Core\Mail\MailerInterface or the \Symfony\Component\Mailer\MailerInterface in your classes and explicitly pass your MailMessage to the send method. Do not call the send method on the MailMessage object itself because this will bypass the shipped decorator and you cannot send your email messages asynchronously

ConfigurationProvider

If you have installed typo3/cms-lowlevel you can see your Messenger configuration within the Configuration module under the section Messenger Configuration

You cannot only see your System wide configuration but also your Messages and the assigned Handlers.

Environment specific configurations

If you want to handle i.e. your messages synchronously in the development environment but still asynchronously in the production environment you can do so. You just have to place another Messenger.php under Configuration/dev/ in your extension. You can do the same for your testing environment by placing the Messenger.php under Configuration/test/ folder. It is a simple convention but convenient in your daily developer life. Have a look at Handling Messages Sync while Developing why this feature is so convenient.

Further reading

Batch processing with Messenger

Symfony Messenger without Supervisor

Credits

Icons used in this repository are made by [Freepik][8] from [www.flaticon.com][9]


All versions of t3-messenger with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8.0
typo3/cms-core Version ^10.4 || ^11.5 || ^12.4
typo3/cms-extbase Version ^10.4 || ^11.5 || ^12.4
symfony/messenger Version ^5.0 || ^6.2
symfony/options-resolver Version ^5.0 || ^6.2
symfony/doctrine-messenger Version ^5.0 || ^6.2
psr/cache Version ^1.0 || ^2.0
ssch/typo3-psr-cache-adapter Version ^1.2
ext-json Version *
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 ssch/t3-messenger contains the following files

Loading the files please wait ....