PHPackages                             swoole-bundle/swoole-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. [HTTP &amp; Networking](/categories/http)
4. /
5. swoole-bundle/swoole-bundle

ActiveLibrary[HTTP &amp; Networking](/categories/http)

swoole-bundle/swoole-bundle
===========================

Open/Swoole Symfony Bundle

v0.28.0(2w ago)7262.8k↓18.3%13[7 issues](https://github.com/symfony-swoole/swoole-bundle/issues)[5 PRs](https://github.com/symfony-swoole/swoole-bundle/pulls)MITPHPPHP ^8.3CI passing

Since Oct 7Pushed 5d ago3 watchersCompare

[ Source](https://github.com/symfony-swoole/swoole-bundle)[ Packagist](https://packagist.org/packages/swoole-bundle/swoole-bundle)[ Docs](https://github.com/symfony-swoole/swoole-bundle)[ GitHub Sponsors](https://github.com/Rastusik)[ GitHub Sponsors](https://github.com/symfony-swoole)[ RSS](/packages/swoole-bundle-swoole-bundle/feed)WikiDiscussions develop Synced 3d ago

READMEChangelog (10)Dependencies (185)Versions (78)Used By (0)

Swoole Bundle
=============

[](#swoole-bundle)

[![Maintainability](https://camo.githubusercontent.com/3ca6f0709dcf73761411b25b894c35eab5553ac98a70da03bebd29c6a8d57bd6/68747470733a2f2f716c74792e73682f67682f73796d666f6e792d73776f6f6c652f70726f6a656374732f73776f6f6c652d62756e646c652f6d61696e7461696e6162696c6974792e737667)](https://qlty.sh/gh/symfony-swoole/projects/swoole-bundle)[![Code Coverage](https://camo.githubusercontent.com/0d87bb5c1635cc4bb367ef8b8a68a16382bfaf7757ff28d655bdae395deb1204/68747470733a2f2f716c74792e73682f67682f73796d666f6e792d73776f6f6c652f70726f6a656374732f73776f6f6c652d62756e646c652f636f7665726167652e737667)](https://qlty.sh/gh/symfony-swoole/projects/swoole-bundle)[![Open Source Love](https://camo.githubusercontent.com/a8a6219cf0313b681948382bcbcc27a34ae00572d463437bd92ebb1df58647c9/68747470733a2f2f6261646765732e66726170736f66742e636f6d2f6f732f76312f6f70656e2d736f757263652e7376673f763d313033)](https://github.com/ellerbrock/open-source-badges/)[![MIT Licence](https://camo.githubusercontent.com/fabb40ab22588a0746bb0916ed92739171bde7fb31f281c627aa588bcba62cc2/68747470733a2f2f6261646765732e66726170736f66742e636f6d2f6f732f6d69742f6d69742e7376673f763d313033)](https://opensource.org/licenses/mit-license.php)

Symfony integration with [Open Swoole](https://openswoole.com/) and [Swoole](https://wiki.swoole.com/en/#/) to speed up your applications.

Sponsored by:[Blackfire.io](https://blackfire.io/)[![Blackfire.io](docs/img/blackfire-io.png)](https://blackfire.io/)---

Build Matrix
------------

[](#build-matrix)

CI JobBranch [`master`](https://github.com/symfony-swoole/swoole-bundle/tree/master)Branch [`develop`](https://github.com/symfony-swoole/swoole-bundle/tree/develop)Circle[![CircleCI](https://camo.githubusercontent.com/f23a279e5e5d0e6e4fdd4c49134957d9a6d5e1f82b61757dc49e47cc4d70a062/68747470733a2f2f636972636c6563692e636f6d2f67682f73796d666f6e792d73776f6f6c652f73776f6f6c652d62756e646c652f747265652f6d61737465722e7376673f7374796c653d737667)](https://circleci.com/gh/symfony-swoole/swoole-bundle/tree/master)[![CircleCI](https://camo.githubusercontent.com/9b4f11305d152ed2cf66d7949544c389cd92395b12e294db4effc8ed5ac7b6d8/68747470733a2f2f636972636c6563692e636f6d2f67682f73796d666f6e792d73776f6f6c652f73776f6f6c652d62756e646c652f747265652f646576656c6f702e7376673f7374796c653d737667)](https://circleci.com/gh/symfony-swoole/swoole-bundle/tree/develop)Table of Contents
-----------------

[](#table-of-contents)

- [Swoole Bundle](#swoole-bundle)
    - [Build Matrix](#build-matrix)
    - [Table of Contents](#table-of-contents)
    - [Quick start guide](#quick-start-guide)
    - [Features](#features)
    - [Requirements](#requirements)
        - [Current version](#current-version)
        - [Future versions](#future-versions)
        - [Open Swoole](#open-swoole)
            - [Version check](#version-check)
            - [Installation](#installation)

Quick start guide
-----------------

[](#quick-start-guide)

1. Make sure you have installed proper Open Swoole PHP Extension and pass other [requirements](#requirements).
2. (optional) Create a new symfony project

    ```
    composer create-project symfony/skeleton project

    cd ./project
    ```
3. Install bundle in your Symfony application

    ```
    composer require swoole-bundle/swoole-bundle
    ```

    If using OpenSwoole, you need to also install the core package:

    ```
    composer require openswoole/core
    ```
4. Edit `config/bundles.php`

    ```
    return [
        // ...other bundles
        SwooleBundle\SwooleBundle\Bridge\Symfony\Bundle\SwooleBundle::class => ['all' => true],
    ];
    ```
5. Run Swoole HTTP Server

    ```
    bin/console swoole:server:run
    ```
6. Enter
7. You can now configure bundle according to your needs

Features
--------

[](#features)

- Built-in API Server

    Swoole Bundle API Server allows managing Swoole HTTP Server in real-time.

    - Reload worker processes
    - Shutdown server
    - Access metrics and settings
- Improved static files serving

    Swoole HTTP Server provides a default static files handler, but it lacks supporting many `Content-Types`. To overcome this issue, there is a configurable Advanced Static Files Server. Static files serving remains enabled by default in the development environment. Static files directory defaults to `%kernel.project_dir%/public`. To configure your custom mime types check [configuration reference](docs/configuration-reference.md) (key `swoole.http_server.static.mime_types`).
- Symfony Messenger integration

    *Available since version: `0.6`*

    Swoole Server Task Transport has been integrated into this bundle to allow easy execution of asynchronous actions. Documentation of this feature is available [here](docs/swoole-task-symfony-messenger-transport.md).
- Hot Module Reload (HMR) for development **ALPHA**

    Since Swoole HTTP Server runs in Event Loop and does not flush memory between requests, to keep DX equal with normal servers, this bundle uses code replacement technique, using `inotify` PHP Extension to allow continuous development. It is enabled by default (when the extension is found) and requires no additional configuration. You can turn it off in bundle configuration.

    *Remarks: This feature currently works only on a Linux host machine. It probably won't work with Docker, and it is possible that it works only with configuration: `swoole.http_server.running_mode: process` (default).*
- Access logs, (disabled by default) logs are configurable is a same way as apache mod log. Documentation of this feature is available [here](docs/swoole-access-logs.md).

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

[](#requirements)

### Current version

[](#current-version)

- PHP version `>= 8.3 &&
