PHPackages                             khvalov/centrifuge-php-cli - 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. [CLI &amp; Console](/categories/cli)
4. /
5. khvalov/centrifuge-php-cli

ActiveLibrary[CLI &amp; Console](/categories/cli)

khvalov/centrifuge-php-cli
==========================

Centrifuge 2.X client writen on PHP

24PHP

Since Aug 4Pushed 6y agoCompare

[ Source](https://github.com/khvalov/centrifuge-php-cli)[ Packagist](https://packagist.org/packages/khvalov/centrifuge-php-cli)[ RSS](/packages/khvalov-centrifuge-php-cli/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependenciesVersions (1)Used By (0)

centrifuge-php-cli
==================

[](#centrifuge-php-cli)

Centrifuge server client written on PHP7

```
require('./vendor/autoload.php');
use CentrifugeClient\CentrifugeClient;
$token='Your JWT Token. Feel free to use any or \Firebase\JWT libbrary to create it';

$centrifugeClient=new CentrifugeClient('ws://your-server-running-centrifuge/connection/websocket');
$centrifugeClient->setToken($token); //Put your token

$centrifugeClient->on(CentrifugeClient::EVENT_CONNECTED,function(){
	echo "Connected"; //configuring Events if any
});

$centrifugeClient->on(CentrifugeClient::EVENT_DISCONNECTED,function($event){
	var_dump($event); //configuring Events if any
});

$centrifugeClient->subscribe('3efe3c40-c0fa-11e8-b3f4-1c51435d0814',function($message){
	echo "Beginning of process...";
	var_dump($message);
	echo "End of the process...";

});

$centrifugeClient->connect(); //running main loop

```

\#Installing:#

```
composer install khvalov/centrifuge-php-cli

```

\#Events:#

Currently Library support only 2 events:

- EVENT\_CONNECTED
- EVENT\_DISCONNECTED

\#Known limits#

Yeah, it's PHP and it's designed to die (c). Constant loop using PHP is defenetly bad idea, but nevertheless here some known limits:

- It's not supports (at least now) unsubscribe function by design
- Running php 7.1+ version as utilizing lambda functions a lot
- Not supporting reconnection yet (have some ideas how to do it)
- Not tested so much yet, not recomended for production related products/services
- Support only websocket WS protocol (and most probably WSS, but not tested)

Any contributions are welcome

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 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/2668527?v=4)[khvalov](/maintainers/khvalov)[@khvalov](https://github.com/khvalov)

---

Top Contributors

[![khvalov](https://avatars.githubusercontent.com/u/2668527?v=4)](https://github.com/khvalov "khvalov (10 commits)")

### Embed Badge

![Health badge](/badges/khvalov-centrifuge-php-cli/health.svg)

```
[![Health](https://phpackages.com/badges/khvalov-centrifuge-php-cli/health.svg)](https://phpackages.com/packages/khvalov-centrifuge-php-cli)
```

###  Alternatives

[wp-cli/wp-cli

WP-CLI framework

5.0k17.2M320](/packages/wp-cli-wp-cli)[consolidation/annotated-command

Initialize Symfony Console commands from annotated command class methods.

22569.8M19](/packages/consolidation-annotated-command)[chi-teck/drupal-code-generator

Drupal code generator

26947.8M5](/packages/chi-teck-drupal-code-generator)[seld/cli-prompt

Allows you to prompt for user input on the command line, and optionally hide the characters they type

24725.8M17](/packages/seld-cli-prompt)[illuminate/console

The Illuminate Console package.

12944.1M5.1k](/packages/illuminate-console)[php-tui/php-tui

Comprehensive TUI library heavily influenced by Ratatui

589747.0k6](/packages/php-tui-php-tui)

PHPackages © 2026

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