PHPackages                             tweet9ra/logux-processor - 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. tweet9ra/logux-processor

ActiveLibrary

tweet9ra/logux-processor
========================

5.0.3(5y ago)37451MITPHPPHP ^7.1.0CI failing

Since Dec 13Pushed 5y ago2 watchersCompare

[ Source](https://github.com/tweet9ra/logux-php)[ Packagist](https://packagist.org/packages/tweet9ra/logux-processor)[ RSS](/packages/tweet9ra-logux-processor/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (4)Dependencies (1)Versions (25)Used By (1)

Logux processor for php
=======================

[](#logux-processor-for-php)

This package allows to use Logux server as proxy between logux server and your php app.

[Laravel adapter for this package](https://github.com/tweet9ra/logux-laravel)

Version compatibility with logux backend protocol:

Package versionLogux backend protocol version&lt; 4.0.02^4.0.03^5.0.04Quick start
-----------

[](#quick-start)

`composer require tweet9ra/logux-processor`

### Initialization

[](#initialization)

- Load config

```
/**
* password - logux controll password, that you specify in logux proxy
* control_url - logux proxy http endpoint (usually http://localhost:31338)
* protocol_version - version of protocol, default 2
*/
$app = new tweet9ra\Logux\App('password', 'control_url', 'protocol_version');
```

- Set routes

```
use \tweet9ra\Logux\ProcessableAction;

$app->setActionsMap([
    /**
    * If your logux proxy does not authenticate itself, you must specify this action
    */
    'auth' => function (array $loguxAuthCommand): bool {
        $userId = $loguxAuthCommand['userId'];
        $token = $loguxAuthCommand['token'];

        /* Anonymous login */
        if ($userId === 'false') {
            return true;
        }

        return function_that_validates_token($userId, $token);
    },

    /**
    * This action handle subscriptions to channels
    * You can use callback or match with assoative array
    */
    'logux/subscribe' => function (ProcessableAction $action) {},
    'logux/subscribe' => [
        'chats/:chatId' => function (ProcessableAction $action, $chatId) {},
        'users/:userId/alert/:alertType' => function (ProcessableAction $action, $userId, $alertType) {}
    ],

    // Your app actions
    'ADD_CHAT_MESSAGE' => function (ProcessableAction $action) {
        if (!user_can_add_messages($action->userId())) {
            // If you have an error while processing action you can use error method
            $action->error('You are not allowed to sent messages!');
            return;
        }

        /* Your logic */
    },

    // Or instead of closures you can specify callback method
    'ADD_CHAT_MESSAGE' => 'App\Controllers\ChatController@addMessage',
    'auth' => 'App\Controllers\AuthController@loguxAuth'
]);
```

All your callbacks takes `\tweet9ra\Logux\ProcessableAction` as first argument, but it can be replaced with child class:

```
/**
 * @property int $text Message text content
 * @property int $chatId Chat room id
 *
 * There is no useful features besides IDE autocompletion atm
*/
class AddChatMessage extends \tweet9ra\Logux\ProcessableAction {}

$app->setActionsMap([
    'ADD_CHAT_MESSAGE' => function (AddChatMessage $action) {
        create_chat_message($action->userId(), $action->text, $action->chatId);
        // Resend action to channels, users, clients or nodes
        $action->sendTo('channels', "chats/$action->chatId");
    }
]);
```

### Process request from logux proxy

[](#process-request-from-logux-proxy)

```
$input = file_get_contents('php://input');
$inputDecoded = json_decode($input, true);

$responseContent = $app->processRequest($inputDecoded);

echo json_encode($response);
```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 84.2% 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 ~8 days

Recently: every ~15 days

Total

24

Last Release

2156d ago

Major Versions

1.2.0.x-dev → 2.0.0.x-dev2020-01-29

2.1.1.x-dev → 3.0.02020-03-17

3.0.1.x-dev → 4.0.02020-04-17

4.0.1.x-dev → 5.0.02020-06-17

### Community

Maintainers

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

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

---

Top Contributors

[![tweet9ra](https://avatars.githubusercontent.com/u/34438790?v=4)](https://github.com/tweet9ra "tweet9ra (32 commits)")[![dotterian](https://avatars.githubusercontent.com/u/6250486?v=4)](https://github.com/dotterian "dotterian (6 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tweet9ra-logux-processor/health.svg)

```
[![Health](https://phpackages.com/badges/tweet9ra-logux-processor/health.svg)](https://phpackages.com/packages/tweet9ra-logux-processor)
```

PHPackages © 2026

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