PHPackages                             easyconn/reactphp-slim - 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. [Framework](/categories/framework)
4. /
5. easyconn/reactphp-slim

ActiveLibrary[Framework](/categories/framework)

easyconn/reactphp-slim
======================

Slim Request and Response extended to allow reactPHP serve a Slim framework instance

v0.4.2(9y ago)127MITPHPPHP ^7.0

Since Jul 13Pushed 9y ago1 watchersCompare

[ Source](https://github.com/easyconn/reactphp-slim)[ Packagist](https://packagist.org/packages/easyconn/reactphp-slim)[ RSS](/packages/easyconn-reactphp-slim/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (2)Versions (4)Used By (0)

reactphp-slim
=============

[](#reactphp-slim)

Introduction
------------

[](#introduction)

This library is created in order to use reactPHP as a HTTP server for Slim framework, I have extended Slim request and response objects to implement functions which allows us to transfer data from native reactPHP objects into Slim objects. With this we will be able to create a basic react server for Slim framework.

Now working on a new way to setup the reactPHP server and run the Slim Application, please use v0.4.2 release (doc bellow), this version is not finished yet, I'm testing it.

```
require '../vendor/autoload.php';

use \mbarquin\reactSlim;

// We keep a new Slim app instance.
$app = new \Slim\App();

// We add a closure to attend defined request routes
$app->any('/hello/{name}', function (
        \Slim\Http\Request $request,
        \Slim\Http\Response $response) {

        $name = $request->getAttribute('name');
        $response->getBody()->write("Hello, $name");

        return $response;
    });

$server = new \mbarquin\reactSlim\Server();

$server->withPort(1337)->run($app);
```

### v0.4.2 Setup

[](#v042-setup)

This is the old setup to run the reactPHP server with a slimPHP application

```
require '../vendor/autoload.php';

use mbarquin\reactSlim;

// We keep a new Slim app instance.
$app = new \Slim\App();

// We add a closure to listen defined request routes
$app->get('/hello/{name}', function (
        \mbarquin\reactSlim\Request $request,
        \mbarquin\reactSlim\Response $response) {

        $name = $request->getAttribute('name');
        $response->getBody()->write("Hello, $name");

        return $response;
    });

// We create a closure to be attached to server request event.
$serverCallback = function (
       \React\Http\Request $request,
       \React\Http\Response $response) use ($app){

    $slRequest  = \mbarquin\reactSlim\Request::createFromReactRequest($request);
    $slResponse = new \mbarquin\reactSlim\Response();

    $app->process($slRequest, $slResponse);

    $slResponse->setReactResponse($response, true);
};

// We make the setup of the ReactPHP
$loop   = React\EventLoop\Factory::create();
$socket = new React\Socket\Server($loop);
$http   = new React\Http\Server($socket, $loop);

// Ligamos la closure al evento request.
$http->on('request', $serverCallback);

echo "Server running at http://127.0.0.1:1337\n";

$socket->listen(1337);
$loop->run();
```

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% 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 ~25 days

Total

3

Last Release

3590d ago

### Community

Maintainers

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

---

Top Contributors

[![mbarquin](https://avatars.githubusercontent.com/u/6476519?v=4)](https://github.com/mbarquin "mbarquin (11 commits)")[![zz](https://avatars.githubusercontent.com/u/41499?v=4)](https://github.com/zz "zz (11 commits)")

### Embed Badge

![Health badge](/badges/easyconn-reactphp-slim/health.svg)

```
[![Health](https://phpackages.com/badges/easyconn-reactphp-slim/health.svg)](https://phpackages.com/packages/easyconn-reactphp-slim)
```

###  Alternatives

[ccxt/ccxt

A cryptocurrency trading API with more than 100 exchanges in JavaScript / TypeScript / Python / C# / PHP / Go

43.1k337.6k1](/packages/ccxt-ccxt)[zubzet/framework

 A lightweight PHP framework focused on rapid development, ease of use, and great portability.

1370.1k1](/packages/zubzet-framework)[vesp/core

Vesp core library to make backend simple

243.9k5](/packages/vesp-core)[duxweb/dux-lite

The lightweight framework based on slim php

161.0k9](/packages/duxweb-dux-lite)

PHPackages © 2026

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