PHPackages                             rivulent/socket.io-php-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. [HTTP &amp; Networking](/categories/http)
4. /
5. rivulent/socket.io-php-emitter

ActiveLibrary[HTTP &amp; Networking](/categories/http)

rivulent/socket.io-php-emitter
==============================

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

0.2(3y ago)0122MITPHPPHP &gt;=5.3

Since May 15Pushed 3y agoCompare

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

READMEChangelog (1)Dependencies (2)Versions (3)Used By (0)

[![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

19

—

LowBetter than 9% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity31

Early-stage or recently created project

 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 ~0 days

Total

2

Last Release

1134d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/148116a28c04d79b68a94cc384c497573ad7573d76f385065eeb76b0109433f3?d=identicon)[rivulent](/maintainers/rivulent)

---

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

Socket.ioemit

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[rase/socket.io-emitter

A PHP implementation of socket.io-emitter

345246.9k3](/packages/rase-socketio-emitter)[elephantio/elephant.io

Send events to a socket.io server through PHP

136801.9k7](/packages/elephantio-elephantio)[illuminate/http

The Illuminate Http package.

11937.2M6.5k](/packages/illuminate-http)[rdkafka/rdkafka

A PHP extension for Kafka

2.2k20.0k1](/packages/rdkafka-rdkafka)[ashiina/socket.io-emitter

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

37372.4k1](/packages/ashiina-socketio-emitter)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.3M84](/packages/mezzio-mezzio-router)

PHPackages © 2026

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