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. [Utility &amp; Helpers](/categories/utility)
4. /
5. lnked/pubsub

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

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 2w 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 18% 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://avatars.githubusercontent.com/u/868121?v=4)[Edik Bulikyan](/maintainers/lnked)[@lnked](https://github.com/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)
```

###  Alternatives

[symfony/polyfill-php56

Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions

1.6k208.5M28](/packages/symfony-polyfill-php56)[pear/pear-core-minimal

Minimal set of PEAR core files to be used as composer dependency

8078.0M78](/packages/pear-pear-core-minimal)[webgriffe/sylius-table-rate-shipping-plugin

Provides table rate shipping calculator.

1493.8k](/packages/webgriffe-sylius-table-rate-shipping-plugin)[friends-of-hyva/magento2-preload-images

Preload images above the fold to improve performance metrics.

2318.4k](/packages/friends-of-hyva-magento2-preload-images)[cebe/luya-module-sitemap

sitemap.xml module for luya CMS

116.0k](/packages/cebe-luya-module-sitemap)

PHPackages © 2026

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