PHPackages                             jegarn/jegarn-php - 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. jegarn/jegarn-php

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

jegarn/jegarn-php
=================

Jegarn-PHP is a implementation of jegarn client

142[1 issues](https://github.com/jegarn/jegarn-php/issues)PHP

Since Oct 7Pushed 9y agoCompare

[ Source](https://github.com/jegarn/jegarn-php)[ Packagist](https://packagist.org/packages/jegarn/jegarn-php)[ RSS](/packages/jegarn-jegarn-php/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Jegarn PHP SDK
==============

[](#jegarn-php-sdk)

php implementation of jegarn client.

Install
-------

[](#install)

```
composer require jegarn/jegarn-php

```

Example
-------

[](#example)

connect

```
$client = new SwooleClient("jegarn.com", 9501, 5000);
$client->setConfig([
    'open_length_check'     => 1,
    'package_length_type'   => 'N',
    'package_length_offset' => 0,
    'package_body_offset'   => 4,
    'package_max_length'    => 2048,
    'socket_buffer_size'    => 1024 * 1024 * 2,
    'daemonize'             => 1,
    'ssl_cert_file'         => __DIR__ . '/ssl.crt',
    'ssl_key_file'          => __DIR__ . '/ssl.key'
]);
$client->setUser("account", "password");
$client->setConnectListener(function($client){
    echo "connect\n";
});
$client->setDisconnectListener(function($cilent){
    echo "disconnect\n";
});
$client->setErrorListener(function(ErrorObject $errorObject, $client){
    echo 'error code:',$errorObject->code, "\n";
});
$client->setSendListener(function(Base $packet, $client){
    echo "send:\n"; print_r($packet); echo "\n";
});
// new message listener
$client->setPacketListener(function(Base $pkt, $client){
    echo "recv:\n"; print_r($pkt); echo "\n";
});

```

send new message

```
$packet = new TextChat();
$packet->from = "my_uid";
$packet->to = "friend_uid";
$packet->setText("hello");
$client->sendPacket($packet);

```

License
-------

[](#license)

[Apache License Version 2.0](./LICENSE)

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

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

---

Top Contributors

[![yaoguais](https://avatars.githubusercontent.com/u/6268554?v=4)](https://github.com/yaoguais "yaoguais (1 commits)")

### Embed Badge

![Health badge](/badges/jegarn-jegarn-php/health.svg)

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

###  Alternatives

[commerceguys/tax

Tax library with a flexible data model, predefined tax rates, powerful resolving logic.

284775.0k](/packages/commerceguys-tax)[supercool/tools

A collection of useful tools for Craft CMS websites

5418.1k](/packages/supercool-tools)

PHPackages © 2026

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