Download the PHP package cvek/domain-events without Composer

On this page you can find all versions of the php package cvek/domain-events. 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 domain-events

Domain events bundle for Symfony

The bundle integrates with Symfony application to provide domain events support. This allows to be doctrine-agnostic and raise events during the business logic implementation.

Domain events are of three types:

To use this bundle implement RaiseEventsInterface interface in your entity class and create your custom domain events. We recommend you to use RaiseEventsTrait to simplify this even more.

Sync/Async messages

Any domain event can be executed in a sync or an async way during onFlush and postFlush Doctrine events. Extend one of abstract classes: AbstractSyncDomainEvent or AbstractAsyncDomainEvent to have sync or async event respectively.

Async way is a very powerful approach and must be used in the following cases:

Thanks to db transport with doctrine storage (will be created automatically) - all the async domain events will be routed and persisted to db automatically.

To consume them we recommend to use the following supervisor config:

:warning: Dont forget to add it to your application!

Direct Async message

If you dont want to write your own async message handler, but dispatch your message directly, then simply extend AbstractDirectAsyncDomainEvent in your message and use it this way:

The message will be dispatched directly to bus, without of need to write your own handler.

Example

Install

composer req cvek/domain-events

Use

Create domain event

Sync event
Async event

Raise event in your business layer

Catch event in listener

When flush operation will be invoked, all the events, raised in your entities, will be collected and dispatched. You can listen on them in a usual manner.

Listen on sync message
Listen on async message

All versions of domain-events with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|^8.0
symfony/config Version ^4.0|^5.0|^6.0
symfony/dependency-injection Version ^4.0|^5.0|^6.0
symfony/http-kernel Version ^4.0|^5.0|^6.0
symfony/event-dispatcher Version ^4.0|^5.0|^6.0
symfony/doctrine-bridge Version ^4.0|^5.0|^6.0
doctrine/orm Version ^2.0
symfony/messenger Version ^4.0|^5.0|^6.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 cvek/domain-events contains the following files

Loading the files please wait ....