PHPackages                             ashiina/socket.io-emitter - 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. [Caching](/categories/caching)
4. /
5. ashiina/socket.io-emitter

ActiveLibrary[Caching](/categories/caching)

ashiina/socket.io-emitter
=========================

\*Maintained\* A PHP implementation of socket.io-emitter

0.8.0(10y ago)38383.3k↓42%12[1 PRs](https://github.com/ashiina/socket.io-php-emitter/pulls)1MITPHPPHP &gt;=5.3

Since Oct 9Pushed 9y ago6 watchersCompare

[ Source](https://github.com/ashiina/socket.io-php-emitter)[ Packagist](https://packagist.org/packages/ashiina/socket.io-emitter)[ Docs](https://github.com/ashiina/socket.io-php-emitter)[ RSS](/packages/ashiina-socketio-emitter/feed)WikiDiscussions develop Synced 2w ago

READMEChangelogDependencies (2)Versions (8)Used By (1)

[![Build Status](https://camo.githubusercontent.com/4cd0e42f8599ee4ae7ec16fe7867b57c5da35715f09b2c8fca059781beae3936/68747470733a2f2f7472617669732d63692e6f72672f61736869696e612f736f636b65742e696f2d7068702d656d69747465722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/ashiina/socket.io-php-emitter)

### *Maintained Fork*

[](#maintained-fork)

This is a fork of [rase-/socket.io-php-emitter](https://github.com/rase-/socket.io-php-emitter).
Since the original repo is not being maintained anymore and is having compatibility problems with newer versions of Socket.io, I recommend using this repo, and also submitting issues here.

[@ashiina](https://github.com/ashiina)

socket.io-php-emitter
=====================

[](#socketio-php-emitter)

A PHP implementation of socket.io-emitter.

Install and Set Up
------------------

[](#install-and-set-up)

### 1. socket.io-php-emitter

[](#1-socketio-php-emitter)

To install and use in your PHP project, install it as a [composer package](https://packagist.org/packages/ashiina/socket.io-emitter). Install dependencies with `composer install`.

### 2. Redis server

[](#2-redis-server)

You need a redis server to emit events to. Set up your redis server.

### 3. socket.io-redis (node.js)

[](#3-socketio-redis-nodejs)

To receive the emitted events, you are required to use `socket.io-redis`. It will automatically handle the event published from `socket.io-php-emitter`. Install and set up from here :

Usage
-----

[](#usage)

### Initialization

[](#initialization)

```
$redis = new \Redis(); // Using the Redis extension provided client
$redis->connect('127.0.0.1', '6379');
$emitter = new SocketIO\Emitter($redis);
$emitter->emit('event', 'payload str');
```

### Broadcasting and other flags

[](#broadcasting-and-other-flags)

Possible flags

- json
- volatile
- broadcast

```
// Below initialization will create a  phpredis client, or a TinyRedisClient depending on what is installed
$emitter = new SocketIO\Emitter(array('port' => '6379', 'host' => '127.0.0.1'));
// broadcast can be replaced by any of the other flags
$emitter->broadcast->emit('other event', 'such data');
```

### Emitting objects

[](#emitting-objects)

```
$emitter = new SocketIO\Emitter(); // If arguments are not provided, they will default to array('port' => '6379', 'host' => '127.0.0.1')
$emitter->emit('event', array('property' => 'much value', 'another' => 'very object'));
```

### About PHP Redis clients

[](#about-php-redis-clients)

This project requires a Redis client for PHP. If you dont have the [PECL Redis](https://github.com/nicolasff/phpredis) installed, the emitter will default to using [TinyRedisClient](https://github.com/ptrofimov/tinyredisclient). You can, however, pass in any Redis client that supports a `publish` method.

### Development

[](#development)

To run tests, invoke `make test`. The current test suite will just be checking redis monitor that everything is published correctly. Some work will be put into making a better integration test suite in the near future.

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity47

Moderate usage in the ecosystem

Community20

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 57.6% 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 ~151 days

Total

5

Last Release

3724d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a31b81fe06edfc6862c62f8d7635985c1e7fb919c4c7dfe52c9dc95a6c12ab43?d=identicon)[ashiina](/maintainers/ashiina)

---

Top Contributors

[![ashiina](https://avatars.githubusercontent.com/u/1379373?v=4)](https://github.com/ashiina "ashiina (19 commits)")[![rase-](https://avatars.githubusercontent.com/u/1220601?v=4)](https://github.com/rase- "rase- (12 commits)")[![kitek](https://avatars.githubusercontent.com/u/1109937?v=4)](https://github.com/kitek "kitek (1 commits)")[![marcguyer](https://avatars.githubusercontent.com/u/35496?v=4)](https://github.com/marcguyer "marcguyer (1 commits)")

---

Tags

nodejsphpredissocket-iosocketiosocketio-redisSocket.ioemit

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ashiina-socketio-emitter/health.svg)

```
[![Health](https://phpackages.com/badges/ashiina-socketio-emitter/health.svg)](https://phpackages.com/packages/ashiina-socketio-emitter)
```

###  Alternatives

[rase/socket.io-emitter

A PHP implementation of socket.io-emitter

347253.9k4](/packages/rase-socketio-emitter)[iazaran/smart-cache

Smart Cache is a caching optimization package designed to enhance the way your Laravel application handles data caching. It intelligently manages large data sets by compressing, chunking, or applying other optimization strategies to keep your application performant and efficient.

21114.2k](/packages/iazaran-smart-cache)[ichhabrecht/intcache

Turn uncachable page objects into cacheable links

193.9k](/packages/ichhabrecht-intcache)

PHPackages © 2026

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