DPC2019: PSR-14: A major PHP Event - Larry Garfield

Php

Explore the latest developments in PHP event handling with PSR-14, a powerful and flexible event system, and learn how it simplifies event handling and integration with various frameworks.

Key takeaways
  • PSR14 is a PHP event system that allows for loose coupling and flexibility in event handling.
  • It defines a single interface for providers, allowing for easy integration with various frameworks.
  • Providers can be aggregated to allow multiple events to be handled by a single provider.
  • PSR14 allows for events to be prioritized, with higher priority events being handled first.
  • The system does not require explicit stop propagation, with events automatically stopping once handled by all listeners.
  • PSR14 is designed to be easily implemented and used across various frameworks, such as Symphony, PSR6, and PSR16.
  • The system allows for listeners to be both compiled and lazy, with compiled listeners being simpler and lazy listeners being more complex.
  • PSR14 supports the concept of aggregate providers, which can be used to concatenate multiple providers.
  • The system allows for events to be handled asynchronously, with the option to send events to a queue for later processing.
  • PSR14 is designed to be backwards compatible with existing systems, with a focus on simplicity and ease of implementation.
  • The system encourages design for interoperability, allowing for easy integration with various frameworks and systems.