Download the PHP package phariscope/event without Composer

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

Installation

Usage

Steps are:

Somewhere else:

Sample usage in an aggregate constructor

You SHOULD dispatch a domain event from an aggregate to signal its creation. This helps apply the Single Responsibility Principle: cross‑cutting concerns (emails, projections, integrations) live in listeners rather than inside the aggregate.

Immediate distribution

By default, events dispatched via EventDispatcher::dispatch() are queued (FIFO) and processed when you call EventDispatcher::distribute().

If you want events to be processed immediately upon dispatch, enable immediate distribution:

Optional logging

You can plug a PSR-3 logger to observe listener exceptions without breaking the dispatch flow:

Deprecated: the misspelled method distributeImmmediatly() is still available for backward compatibility but will be removed in a future release. Use distributeImmediately() instead.

Resetting subscribers (useful in tests)

When using the singleton in tests or long‑running processes, you may need to reset the subscriptions between scenarios:

PSR-14 compliance (internal integration)

This package integrates PSR-14 semantics internally while preserving the legacy API:

Complete DDD/TDD Examples

For comprehensive examples showing how to use this library in a Domain-Driven Design context with Test-Driven Development, see DDD-TDD-EXAMPLES.md. This documentation covers:

Migration guide: Legacy API → PSR-14 (concepts)

Mapping

Steps

1) Install PSR-14 interfaces (already a dependency of this package): psr/event-dispatcher.

2) Instantiate the legacy dispatcher as usual (PSR semantics are handled internally at distribution time).

3) Enregistrer vos listeners legacy via EventDispatcher::subscribe() comme auparavant.

4) Remplacer les appels de distribution:

5) Propagation stoppable (facultatif): implémentez Psr\EventDispatcher\StoppableEventInterface et retournez true dans isPropagationStopped() pour arrêter l’enchaînement des listeners.

6) Exceptions: sous PSR-14, les exceptions d’un listener ne sont pas avalées. Si votre code dépendait de l’ancienne résilience, entourez l’appel dispatch() d’un try/catch ou adaptez vos listeners.

Event immutability

Events in this library are treated as immutable messages. Listeners MUST NOT modify the event instance they receive. If you need to propagate additional information, dispatch a new event.

To contribute to phariscope/Event

Requirements

Install

Unit test

Using Test-Driven Development (TDD) principles (thanks to Kent Beck and others), following good practices (thanks to Uncle Bob and others) and the great book 'DDD in PHP' by C. Buenosvinos, C. Soronellas, K. Akbary

Quality

Quick check with:

Check coverage with:

and view 'var/index.html' with your browser

Check infection with:

and view 'var/infection.html' with your browser


All versions of event with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
psr/event-dispatcher Version ^1.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 phariscope/event contains the following files

Loading the files please wait ....