Skip to content
Snippets Groups Projects
Commit 0b0f5f1e authored by Benni Mack's avatar Benni Mack Committed by Benjamin Franzke
Browse files

[FEATURE] Introduce PSR-14-based EventDispatcher as alternative for hooks


The new PSR-14 standard for dispatching Events (that is: to extend
a Framework without having to modify a frameworks' code) adds
a EventDispatcher object that can dispatch Event objects to
EventListeners.

In PSR-14 every dispatched event is an object. It uses PHP class names as
identifiers for events. Class hierarchies may be used to group events.

A ListenerProvider object collects available listeners from an extension
and allows to listen and/or modify data provided by the Event object.

The current implementation relies on a custom TYPO3-specific
ListenerProvider that is configured using Symfony's Dependency Injection
tags.

As an example the Mailer-postProcInitialization signal/slot is
replaced by an Event.

This first patch introduces the feature, and does not deprecate
anything yet. The most important part is that new Events
can use this API instead of Hooks in TYPO3 v10.

Short-Term goal is to deprecate SignalSlot dispatcher in TYPO3 v10,
and migrate all signals to the EventDispatcher.

Resolves: #88770
Releases: master
Change-Id: I3649ddb9b9340640199279e6af3c040bffc397fe
Signed-off-by: default avatarBenni Mack <benni@typo3.org>
Signed-off-by: default avatarBenjamin Franzke <bfr@qbus.de>
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/61303


Reviewed-by: default avatarGeorg Ringer <georg.ringer@gmail.com>
Reviewed-by: default avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: default avatarGeorg Ringer <georg.ringer@gmail.com>
parent 57b051d0
Branches
Tags
Showing
with 1121 additions and 27 deletions
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment