Download the PHP package agluh/outbox-bundle without Composer

On this page you can find all versions of the php package agluh/outbox-bundle. 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 outbox-bundle

Outbox bundle

Build Status

Implements Outbox pattern for DDD-based Symfony applications.

How it works:

  1. Bundle collects domain events from aggregate being persisted and save them in a separate table within a single database transaction.
  2. After a successful commit those domain events are enqueued for publication.
    1. If bundle configured with auto_publish=true option, then domain events from outbox table will be processed using a Symfony event listener in the kernel.TERMINATE or console.TERMINATE events.
    2. If bundle configured with auto_publish=false option, then you should use CLI interface described below to periodically run worker for processing of stored events.

Important note: events are enqueued for publishing on-by-one in ascending order sorted by expected publication date (witch by default is date of registration domain event in outbox). If for some reason on DomainEventEnqueuedForPublishingEvent you did not marked domain event as published (i.e. publication date not set) then next time outbox will try to enqueue for publishing the same domain event until it succeeded. This ensures time consistency of published domain events.

Note: you can combine auto publishing with CLI-based publication at the same time. Locking mechanism ensure all events will be published in the right order.

Acknowledgments

Inspired by Domain Event Bundle. Worker class mainly based on Worker from symfony/messenger component.

Installation

Requires Symfony 4.4, or Symfony 5.x and PHP 7.4 and above

Make sure Composer is installed globally, as explained in the installation chapter of the Composer documentation.

Applications that use Symfony Flex

Open a command console, enter your project directory and execute:

Applications that don't use Symfony Flex

Step 1: Download the Bundle

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

Step 2: Enable the Bundle

Then, enable the bundle by adding it to the list of registered bundles in the config/bundles.php file of your project:

Usage

Outbox bundle integrates into your Symfony application mostly by application events. You should implement listeners for them as shown below.

Console commands

Publish domain events

The php process is not designed to work for a long time. So it has to quit periodically. Or, the command may exit because of error or exception. Something has to bring it back and continue events publication (if not used auto publication). You can use Supervisord for that. It starts processes and keep an eye on them while they are working.

Here an example of supervisord configuration.

Note: Pay attention to --time-limit it tells the command to exit after 60 minutes.

Prune published domain events

Stop workers

Custom serializer

By default, outbox bundle uses serialize/unserialize functions from PHP to convert domain event to a string during persistence. You can use a custom serializer for that purpose. For example, how to use symfony/serializer is shown below.

Then register new serializer as a service.

Default configuration

Contributing

Contributions are welcome. Composer scripts are configured for your convenience:


All versions of outbox-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4
symfony/lock Version ^4.4 || ^5.0
symfony/framework-bundle Version ^4.4 || ^5.0
symfony/console Version ^4.4 || ^5.0
doctrine/doctrine-bundle Version ^1.0 || ^2.0
doctrine/orm Version ^2.6
ramsey/uuid-doctrine Version ^1.6
webmozart/assert Version ^1.9
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 agluh/outbox-bundle contains the following files

Loading the files please wait ....