PHPackages                             lnked/pubsub - 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. lnked/pubsub

ActiveLibrary

lnked/pubsub
============

041PHP

Since Oct 18Pushed 8y agoCompare

[ Source](https://github.com/lnked/pubsub)[ Packagist](https://packagist.org/packages/lnked/pubsub)[ RSS](/packages/lnked-pubsub/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

pubsub
======

[](#pubsub)

```
curl -s http://getcomposer.org/installer | php
composer require lnked/pubsub
```

Add an event onto the stack, you can add more than one event in one name:

```
PS::on('event-name', function ($message) {
    print_r($message);
});
```

Trigger event, by name:

```
PS::trigger('event-name');
PS::trigger('event-name', 'event-parameter');
PS::trigger('event-name', [1, 2, 3]);
```

### Methods

[](#methods)

Attach an event handler function for one or more events
=======================================================

[](#attach-an-event-handler-function-for-one-or-more-events)

```
PS::on('event-name', function($message) {
    echo $message;
});
```

Remove an event handler
=======================

[](#remove-an-event-handler)

```
PS::off('event-name');
```

Execute all handlers and behaviors attached to the matched elements for the given event
=======================================================================================

[](#execute-all-handlers-and-behaviors-attached-to-the-matched-elements-for-the-given-event)

```
PS::trigger('event-name');
PS::trigger('event-name', 'test');
PS::trigger('event-name', [1, 2]);
PS::trigger('event-name', 1, 2, 3);
```

List of events
==============

[](#list-of-events)

```
PS::list();
PS::list('event-name');
```

\#Clears all existing events

```
PS::flush();
```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/40a335a0b0f0bf0ffe19de1d85a5c16b46d45f8db9595fa0140e7ea9393df2e6?d=identicon)[lnked](/maintainers/lnked)

---

Top Contributors

[![lnked](https://avatars.githubusercontent.com/u/868121?v=4)](https://github.com/lnked "lnked (7 commits)")

### Embed Badge

![Health badge](/badges/lnked-pubsub/health.svg)

```
[![Health](https://phpackages.com/badges/lnked-pubsub/health.svg)](https://phpackages.com/packages/lnked-pubsub)
```

PHPackages © 2026

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