Download the PHP package communitales/status-bus without Composer

On this page you can find all versions of the php package communitales/status-bus. 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 status-bus

Communitales StatusBus Component

Codequality

Publish status messages without coupling application code to their presentation. Messages can be sent to a PSR-3 logger, a Symfony session flash bag, or any custom handler.

Status delivery is synchronous and best-effort. A failing handler does not affect the calling application or prevent other handlers from receiving the message.

Installation

Usage

Inject StatusBusInterface and publish an immutable StatusMessage:

message can be either a literal message or a translation key. The available factory methods are success(), info(), warning(), and error().

Translation parameters and the translation domain are presentation data. context contains structured diagnostic data for handlers such as the PSR-3 logger and is not shown in flash messages.

Symfony configuration

The following configuration sends every status message to the application logger and to the Symfony flash bag:

Remove either handler registration if only one destination is required.

The log handler maps status levels as follows:

Status PSR-3 level
success notice
info info
warning warning
error error

When a translator is injected, log messages are translated using the optional locale configured on PsrLogStatusHandler. The original message, domain, parameters, and level remain available below the status_message context key.

The flash handler stores a TranslatableMessage instead of rendering it early. Translate the message when displaying it:

The flash handler performs the presentation-specific mapping from status error to Bootstrap flash type danger.

Delivery failures

LogAndContinueDeliveryFailureHandler is the production strategy. It reports a failed delivery through a PSR-3 logger and lets the bus continue with the next handler. It also suppresses logger failures, preserving fire-and-forget behavior.

Use RethrowDeliveryFailureHandler in development or tests when handler failures should fail immediately:

InMemoryStatusHandler is available for tests and exposes received messages via messages().

Custom handlers

Handlers should throw when delivery fails. StatusBus applies the configured failure strategy and decides whether processing continues.


All versions of status-bus with dependencies

PHP Build Version
Package Version
Requires php Version >=8.4
psr/log Version ^3.0
symfony/http-foundation Version ^7.4|^8.1
symfony/translation Version ^7.4|^8.1
symfony/translation-contracts Version ^3.6
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 communitales/status-bus contains the following files

Loading the files please wait ...