Home

Awesome

Swoole Bundle

Maintainability Test Coverage Open Source Love MIT Licence

Symfony integration with Open Swoole to speed up your applications.

Sponsored by:
Blackfire.io<img src="docs/img/blackfire-io.png" width="100" alt="Blackfire.io"/>
Travis CI<img src="https://www.travis-ci.com/wp-content/uploads/2022/09/Logo.png" width="100" alt="Travis CI"/>

Build Matrix

CI JobBranch masterBranch develop
CircleCircleCICircleCI
CodeCovcodecovcodecov
TravisBuild StatusBuild Status

Table of Contents

Quick start guide

  1. Make sure you have installed proper Open Swoole PHP Extension and pass other 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 http://localhost:9501

  7. You can now configure bundle according to your needs

Features

Requirements

Current version

Future versions

Additional requirements to enable specific features:

Swoole

The bundle requires one of those extensions:

Version check

To check your installed version you can run the following command:

// Swoole
php -r "echo swoole_version() . \PHP_EOL;"

# 5.1.1

// OpenSwoole
php -r "echo OpenSwoole\Util::getVersion() . \PHP_EOL;"

# 22.0.0

Installation

Swoole

Official GitHub repository swoole/swoole-src contains comprehensive installation guide. The recommended approach is to install it from source.

OpenSwoole

Official GitHub repository openswoole/ext-openswoole contains comprehensive installation guide. The recommended approach is to install it from source.