PHPackages                             michaelesmith/event-data - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. michaelesmith/event-data

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

michaelesmith/event-data
========================

Abstracts event data handling

0.1(11y ago)068MITPHPPHP &gt;=5.4

Since Aug 29Pushed 7y ago1 watchersCompare

[ Source](https://github.com/michaelesmith/EventData)[ Packagist](https://packagist.org/packages/michaelesmith/event-data)[ Docs](https://github.com/michaelesmith/EventData)[ RSS](/packages/michaelesmith-event-data/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (3)Used By (0)

[![Build Status](https://camo.githubusercontent.com/e33efb36428c18f791d0706f08ec3fa3e06b4ed3096fb09344ce986c06bb8e5d/68747470733a2f2f7472617669732d63692e6f72672f6d69636861656c65736d6974682f4576656e74446174612e737667)](http://secure.travis-ci.org/michaelesmith/EventData)

README
======

[](#readme)

What is it?
-----------

[](#what-is-it)

This is a library that allows for easy abstraction of event data collection and storage, allowing it to be stored locally or external service..

Installation
------------

[](#installation)

### Use Composer (*recommended*)

[](#use-composer-recommended)

Get Composer at

```
php composer.phar require "michaelesmith/event-data" "dev-master"

```

Examples
--------

[](#examples)

This isn't very useful in production to store the events in a local file but might be useful during configuration. You can also configure loggers.

```
$edm = new \MS\EventData\EventDataManager(new \MS\EventData\Storage\File('/tmp/events.txt'));
$edm->addLogger(new \MS\EventData\Logger\GenericLogger());
$edm->store(new \MS\EventData\Event\Event('collection', ['field1' => 'val1']));
```

By default it will send the event immediately but this can be configured.

```
$edm->setDelayed(true);

$edm->store(new \MS\EventData\Event\Event('collection', ['field1' => 'val1']));
...
$edm->store(new \MS\EventData\Event\Event('collection', ['field1' => 'val1']));
...

$edm->flush();
```

In this example the events are not sent to the storage until flush is called.

You can also put it in debug mode so events are logged but never sent to storage.

```
$edm->setDebug(true);

$edm->store(new \MS\EventData\Event\Event('collection', ['field1' => 'val1']));
```

Finally a useful example. Here we send the event data to KeenIO and log with PSR logger like Monolog.

```
$edm = new \MS\EventData\EventDataManager(new \MS\EventData\Storage\KeenIO($keenClient));
$edm->addLogger(new \MS\EventData\Logger\PSRLogger($monolog, $edm));
$edm->setDebug(DEBUG_MODE);
$edm->setDelayed(true);

...
$edm->store(new \MS\EventData\Event\Event('collection', ['field1' => 'val1']));
...

$edm->flush(); //after the response has been returned to the user
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

4281d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/181546?v=4)[Michael Smith](/maintainers/michaelesmith)[@michaelesmith](https://github.com/michaelesmith)

---

Top Contributors

[![michaelesmith](https://avatars.githubusercontent.com/u/181546?v=4)](https://github.com/michaelesmith "michaelesmith (9 commits)")

---

Tags

eventevent data

### Embed Badge

![Health badge](/badges/michaelesmith-event-data/health.svg)

```
[![Health](https://phpackages.com/badges/michaelesmith-event-data/health.svg)](https://phpackages.com/packages/michaelesmith-event-data)
```

###  Alternatives

[doctrine/event-manager

The Doctrine Event Manager is a simple PHP event system that was built to be used with the various Doctrine projects.

6.1k501.1M115](/packages/doctrine-event-manager)[league/event

Event package

1.6k141.6M184](/packages/league-event)[laminas/laminas-eventmanager

Trigger and listen to events within a PHP application

1.0k69.8M225](/packages/laminas-laminas-eventmanager)[winzou/state-machine

A very lightweight yet powerful PHP state machine

52113.7M18](/packages/winzou-state-machine)[spatie/laravel-event-sourcing

The easiest way to get started with event sourcing in Laravel

9003.7M26](/packages/spatie-laravel-event-sourcing)[spatie/laravel-google-calendar

Manage events on a Google Calendar

1.4k1.5M21](/packages/spatie-laravel-google-calendar)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
