Download the PHP package awd-studio/service-buses without Composer

On this page you can find all versions of the php package awd-studio/service-buses. 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 service-buses

Service buses in PHP

A simple library, to implement CQRS-ish pattern on PHP projects.

Build status Coverage Status

Features:

Contents:


Get started:

Requirenments:

Install:

Handling messages:

A message, is nothing, but a simple PHP-object.

It can contain any data you need, but usually, it's better to provide some immutable messages, that can be serialized.

Anyway, you are able to extend or implement anything you need.

A handler-locator is a repository for handlers.

With them, we can assign a handler to particular messages. Library provides some handler locators, for example - a locator to store handlers in memory:

To handle a message, the bus needs to be called. For instance, we have a bus that extends provided SimpleBus.

We're gonna use a

Predefined buses:

There are a few predefined buses:

Command-bus:

Query-bus:

Event-bus:

Subscribe on parents

The library allows subscribing not only on a certain class, but on all of its parents - either a parent or an implementation from any level.

Services as handlers

Of course, to resolve the only callbacks as handlers is not such a convenient way to build projects. Fortunately, we have standards as a PSR-11 for such common use-cases as implementation of DIP. And, the library provides ability to use those containers as service locators for resolving handlers as DI.

To use it, there is a decorator for a handler-locator, that can be used for registering handlers with just FCQN. As a dependency it accepts any of Psr\Container\ContainerInterface, that supposed to resolve handlers.

Auto-register services

There is even a decorator to subscribe callbacks automatically, by their signature, that supposed to contain a type-hint as the very first parameter.

Using your own handling methods

If you don't like invokable services, or somehow need to use handlers that handle via different methods - this is not a problem at all.

Just pass the name of a method while registering:

Define custom bus

To define your own bus, you can extend one of predefined ones. You have 2 options:

The SimpleBus provides you an ability to handle messages with only handles.


Testing:


All versions of service-buses with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
psr/container Version ^1.0|^2.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 awd-studio/service-buses contains the following files

Loading the files please wait ....