This patch provides a forwards-compatibility release that adapts zend-eventmanager to work as a PSR-14 EventDispatcher. It does so by doing the following:
- Creating package-specific
ListenerProviderInterface and EventDispatcherInterface versions that work with PHP 5.6.
- Moving all listener aggregation into classes within a
ListenerProvider subnamespace; this includes both the listener attachment previously in the EventManager instance as well as the SharedEventManager instance.
- Renaming "listener aggregates" to "listener subscribers" in the new
ListenerProvider subnamespace.
- Adapting
EventManager to consume listener providers. By default, it will create a default priority-based listener provider, and have its various listener attachment methods proxy to that provider; it then aggregates that provider with the SharedEventManager (which is itself a provider now) in order to retrieve listeners. This is done in such a way that behavior is completely backwards compatible with current usage.
- A new named constructor,
createUsingListenerProvider(), allows providing a specific listener provider for use with the EventManager. If the provider is attachment capable, the various listener attachment methods will proxy to it; otherwise, they will raise an exception.
The patch also deprecates a number of features, including:
- Most interfaces, including the
EventInterface.
- The entire "shared event manager" concept (this can be accomplished via event object hierarchies instead)
TODO
Originally posted by @weierophinney at zendframework/zend-eventmanager#73
This patch provides a forwards-compatibility release that adapts zend-eventmanager to work as a PSR-14 EventDispatcher. It does so by doing the following:
ListenerProviderInterfaceandEventDispatcherInterfaceversions that work with PHP 5.6.ListenerProvidersubnamespace; this includes both the listener attachment previously in theEventManagerinstance as well as theSharedEventManagerinstance.ListenerProvidersubnamespace.EventManagerto consume listener providers. By default, it will create a default priority-based listener provider, and have its various listener attachment methods proxy to that provider; it then aggregates that provider with the SharedEventManager (which is itself a provider now) in order to retrieve listeners. This is done in such a way that behavior is completely backwards compatible with current usage.createUsingListenerProvider(), allows providing a specific listener provider for use with theEventManager. If the provider is attachment capable, the various listener attachment methods will proxy to it; otherwise, they will raise an exception.The patch also deprecates a number of features, including:
EventInterface.TODO
Originally posted by @weierophinney at zendframework/zend-eventmanager#73