PHPackages                             insidestyles/swoole-bridge-bundle - 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. insidestyles/swoole-bridge-bundle

ActiveSymfony-bundle[Framework](/categories/framework)

insidestyles/swoole-bridge-bundle
=================================

Swoole Bridge For Php Frameworks

v2.1.1(3y ago)313905MITPHPPHP &gt;=7.2

Since Jun 20Pushed 3y ago3 watchersCompare

[ Source](https://github.com/insidestyles/swoole-bridge-bundle)[ Packagist](https://packagist.org/packages/insidestyles/swoole-bridge-bundle)[ RSS](/packages/insidestyles-swoole-bridge-bundle/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (8)Versions (19)Used By (0)

swoole-bridge-bundle
====================

[](#swoole-bridge-bundle)

Symfony Swoole Bridge Bundle

Requirements
------------

[](#requirements)

- PHP &gt;= 7.1
- symfony/framework-bundle: "^5.0|^6.0"
- insidestyles/swoole-bridge: "^1.0"
- symfony/console: "^5.0|^6.0",
- "laminas/laminas-diactoros": "^2.0"

Installation
------------

[](#installation)

This package is installable and autoloadable via Composer

```
composer require insidestyles/swoole-bridge-bundle
```

Update config.yml

```
swoole_bridge:
    server:
        port: "%web_server_port%"      #The port the socket server will listen on
        host: "%web_server_host%"
        configs:
          document_root: '/app/public'
          enable_static_handler: true
          http_compression: true
          http_compression_level: 1
```

Update bundles

```
     Insidestyles\SwooleBridgeBundle\SwooleBridgeBundle::class => ['all' => true],
```

Usage
-----

[](#usage)

```
    php bin/console swoole:bridge:server
```

Create custom handler
---------------------

[](#create-custom-handler)

One of common problems while running long lived program in php is "MySQL server has gone away" (Long lived php daemon running using reactphp, websocket, swoole, ..etc..). In this case we can create a custom handler to handle this error. For example:

```
class CustomHandler implements SwooleBridgeInterface
{
    /**
     * @var SwooleBridgeInterface
     */
    private $swooleBridge;

    /**
     * @var RegistryInterface
     */
    private $doctrineRegistry;

    /**
     * @var LoggerInterface
     */
    private $logger;

    /**
     * Handler constructor.
     * @param SwooleBridgeInterface $swooleBridge
     * @param null|LoggerInterface $logger
     */
    public function __construct(
        SwooleBridgeInterface $swooleBridge,
        RegistryInterface $doctrineRegistry,
        ?LoggerInterface $logger = null
    ) {
        $this->swooleBridge = $swooleBridge;
        $this->doctrineRegistry = $doctrineRegistry;
        $this->logger = $logger ?? new NullLogger();
    }

    /**
     * @inheritdoc
     */
    public function handle(
        SwooleRequest $swooleRequest,
        SwooleResponse $swooleResponse
    ): void {
        try {
            $this->swooleBridge->handle($swooleRequest, $swooleResponse);
        } catch (PDOException $e) {
            $this->logger->error($e->getMessage());
            /** @var Connection $connection */
            $connection = $this->doctrineRegistry->getConnection();
            if (!$connection->ping()) {
                $connection->close();
                $connection->connect();
            }
            $em = $this->doctrineRegistry->getEntityManager();
            if (!$em->isOpen()){
                $this->doctrineRegistry->resetManager();
            }
        } catch (\Throwable $e) {
            $this->logger->error($e->getMessage());
        }
    }
}

```

Override default handler using symfony service decorator:

```
#config/services.yaml
services:
    swoole_bridge.custom_handler:
        class: App\CustomHandler
        decorates: swoole_bridge.handler
        arguments:
            - '@swoole_bridge.custom_handler.inner'
            - '@doctrine'
            - '@logger'
```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 94.4% 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 ~113 days

Recently: every ~264 days

Total

16

Last Release

1193d ago

Major Versions

v0.4.2 → v1.0.02019-04-08

v1.1.1 → v2.0.02023-02-05

PHP version history (2 changes)v0.1.0PHP ^7.2

v2.0.0PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/0dc2a35ddd8fc9e6a19ff10b88a24f740b37f6c2e26e5bb70b4675d12ee42944?d=identicon)[insidestyles](/maintainers/insidestyles)

---

Top Contributors

[![insidestyles](https://avatars.githubusercontent.com/u/6195805?v=4)](https://github.com/insidestyles "insidestyles (17 commits)")[![Vipheak](https://avatars.githubusercontent.com/u/31008729?v=4)](https://github.com/Vipheak "Vipheak (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/insidestyles-swoole-bridge-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/insidestyles-swoole-bridge-bundle/health.svg)](https://phpackages.com/packages/insidestyles-swoole-bridge-bundle)
```

###  Alternatives

[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[laravel/octane

Supercharge your Laravel application's performance.

4.0k21.5M159](/packages/laravel-octane)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[laravel/passport

Laravel Passport provides OAuth2 server support to Laravel.

3.4k85.0M532](/packages/laravel-passport)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)

PHPackages © 2026

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