laminas-eventmanager is a free, open source scheduling & event management project written in PHP and released under BSD-3-Clause. It has 1,016 GitHub stars, 19 forks and 9 open issues, and was last pushed 4 days ago. On this registry it ranks #16 of 23 tracked projects in Scheduling & Event Management, with 5 head-to-head comparisons available.

What is laminas-eventmanager?

What it is

laminas-eventmanager is a PHP library for triggering and listening to events inside an application. It belongs to the Laminas ecosystem, the collection of PHP components and frameworks maintained under the Laminas organization, and it is distributed under the BSD-3-Clause license. The project has been on GitHub for roughly seven years and carries about 1,016 stars with 9 open issues. Its published GitHub description is short and literal: trigger and listen to events within a PHP application.

The concrete problem it solves is decoupling: code that produces something worth reacting to does not need to know which parts of the application care about it. Instead of hard-wiring calls between components, an application attaches listeners to named events and triggers those events at the right moment. The README frames this around three use cases — simple subject/observer patterns, Aspect-Oriented designs, and event-driven architectures — so the library works both as a small structural tool inside one class and as the wiring layer for a larger event-driven system.

Key capabilities

  • Attach listeners to named events, so reactions are registered against an event name rather than a direct method call.
  • Attach listeners on a per-instance basis, keeping the listener set local to one object.
  • Use shared listener collections, so more than one object can draw on the same set of listeners.
  • Detach listeners again, allowing the listener set to change at runtime.
  • Trigger events, which is the call that dispatches a named event to whatever is currently listening.
  • Interrupt execution of listeners, giving a listener a way to stop the dispatch from continuing.
  • Provide benchmark scripts under the benchmarks/ directory, run with PHPBench and the vendor/bin/phpbench run --report=aggregate command.

Who uses it and how

  • Application developers implementing a subject/observer pattern, where one subject notifies registered observers when its state changes.
  • Teams building Aspect-Oriented designs, where behaviour such as logging or validation is attached around existing operations rather than written into them.
  • Projects building event-driven architectures, using named events as the boundary between components.
  • Existing Laminas-based applications, which consume the component as part of that ecosystem.
  • Teams upgrading from version 2 to version 3, following the migration documentation that the README links to
project readme (upstream, from github) — read inline

laminas-eventmanager

Build Status Coverage Status

🇷🇺 Русским гражданам

Мы, участники Laminas, родились и живем в разных странах. У многих из нас есть друзья, родственники и коллеги как в России, так и в Украине. Некоторые из нас родились в России. Некоторые из нас живут в России. У некоторых бабушки и дедушки сражались с фашистами во Второй мировой войне. Здесь никто не поддерживает фашизм.

У одного из нас есть украинская родственница, которая спаслась из дома вместе с сыном. Поезд задержался из-за бомбежки на дороге впереди. У нас есть друзья, которые прячутся в бомбоубежищах. Мы с тревогой ждем весточки от них после воздушных налетов, которые беспорядочно наносят удары и попадают по больницам, школам, детским садам и домам. Мы не берем это из каких-либо СМИ. Мы наблюдаем это напрямую.

Вы доверяете нам достаточно, чтоб использовать наши программы, и мы просим вас довериться нам вновь. Мы нуждаемся в помощи. Выходите и протестуйте против этой бесполезной войны. Остановите кровопролитие. Скажите "Нет войне!"

🇺🇸 To Citizens of Russia

We at Laminas come from all over the world. Many of us have friends, family and colleagues in both Russia and Ukraine. Some of us were born in Russia. Some of us currently live in Russia. Some have grandparents who fought Nazis in World War II. Nobody here supports fascism.

One team member has a Ukrainian relative who fled her home with her son. The train was delayed due to bombing on the road ahead. We have friends who are hiding in bomb shelters. We anxiously follow up on them after the air raids, which indiscriminately fire at hospitals, schools, kindergartens and houses. We're not taking this from any media. These are our actual experiences.

You trust us enough to use our software. We ask that you trust us to say the truth on this. We need your help. Go out and protest this unnecessary war. Stop the bloodshed. Say "stop the war!"

laminas-eventmanager is designed for the following use cases:

  • Implementing simple subject/observer patterns.
  • Implementing Aspect-Oriented designs.
  • Implementing event-driven architectures.

The basic architecture allows you to attach and detach listeners to named events, both on a per-instance basis as well as via shared collections; trigger events; and interrupt execution of listeners.

For migration from version 2 to version 3, please read the migration documentation.

Benchmarks

We provide scripts for benchmarking laminas-eventmanager using the PHPBench framework; these can be found in the benchmarks/ directory.

To execute the benchmarks you can run the following command:

$ vendor/bin/phpbench run --report=aggregate

Frequently asked questions

Is laminas-eventmanager free to use?

laminas-eventmanager is open source under the BSD-3-Clause licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does laminas-eventmanager do?

Trigger and listen to events within a PHP application

What is laminas-eventmanager written in?

laminas-eventmanager is primarily written in PHP. Its source is publicly available at https://github.com/laminas/laminas-eventmanager, and it has 1,016 GitHub stars.