Developed with love by KnpLabs Hire us for your project!
37

swoole-bundle

by k911

Symfony Swoole Bundle

travis
Maintainability
Test Coverage
Open Source Love
MIT Licence

Swoole Bundle

Symfony integration with Swoole to speed up your applications.

Quick start guide

  1. Make sure you have installed proper Swoole PHP Extension and pass other requirements.

  2. Create symfony project

    (You can skip this step if you already have a project)

    composer create-project symfony/skeleton project
    
    cd ./project
    
  3. Install bundle in your symfony application

    composer require k911/swoole-bundle
    
  4. Edit config/bundles.php

    return [
        // ...other bundles
        K911\Swoole\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

  • Improved static files serving

    Swoole HTTP Server provides a default static files handler, but it lacks supporting many Content-Types. In order to overcome this issue, there is (not yet configurable) Advanced Static Files Server. Static files serving is enabled by default in development environment. Static files directory defaults to %kernel.project_dir%/public.

  • Hot Module Reload (HMR) - for development

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

Requirements

  • Swoole PHP Extension ^4.0.0
  • Symfony ^4.1

Additional requirements to enable specific features:
- Inotify PHP Extension ^2.0.0 to use Hot Module Reload (HMR)

Swoole

Bundle requires Swoole PHP Extension version 4.0.0 or higher. Active bugfixes are provided only for latest version.

Version check

To check your installed version you can run following command:

php -r "echo swoole_version();"

# 4.2.3

Installation

To install latest version of swoole use pecl:

pecl install swoole

Or, to skip interactive questions:

echo "\n" | pecl install swoole 
MIT License

Copyright (c) 2018 K911

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
  • chore(release): v0.4.4 :tada:
    By Travis CI User, 10 months ago
  • fix(di): Fix regression introduced in v0.4.3 (#29)
    By web-flow, 10 months ago
  • chore(release): v0.4.3 :tada:
    By Travis CI User, 10 months ago
  • fix(di): Fix detection of doctrine bundle
    By k911, 10 months ago
  • ci(travis): Do not allow for failures on PHP 7.3
    By k911, 10 months ago
  • chore(deps): Upgrade dependencies
    By k911, 10 months ago
  • ci(travis): Upgrade swoole version to 4.2.8
    By k911, 1 year ago
  • ci(travis): Hack usage of ci-pecl-install
    By k911, 1 year ago
  • test(fixtures): Do not use controller base class
    By k911, 1 year ago
  • chore(deps): Upgrade dependencies
    By k911, 1 year ago
  • ci(travis): Migrate to VM based infrastructure (#24)
    By web-flow, 1 year ago
  • chore(deps): Upgrade dependencies
    By k911, 1 year ago
  • docs(changelog): Fix changelog generation
    By k911, 1 year ago
  • chore(release): v0.4.2 :tada:
    By Travis CI User, 1 year ago
  • fix(xdebug-handler): Remove process timeout (#23)
    By k911, 1 year ago
  • docs(changelog): Fix formatting
    By k911, 1 year ago
  • ci(releaser): Do not regenerate whole changelog
    By k911, 1 year ago
  • ci(travis): Fix build with --prefer-lowest
    By k911, 1 year ago
  • ci(travis): Add PHP 7.3 to the build matrix
    By k911, 1 year ago
  • ci(travis): Update tested swoole version to 4.2.5
    By k911, 1 year ago
  • chore(release): v0.4.1 :tada:
    By Travis CI User, 1 year ago
  • fix(xdebug-handler): Replace with custom solution
    By k911, 1 year ago
  • fix(boot-manager): Don't boot not bootable objects
    By k911, 1 year ago
  • chore(deps): Upgrade dependencies
    By k911, 1 year ago
  • chore(release): v0.4.0 :tada:
    By Travis CI User, 1 year ago
  • docs(quick-start): Improve documentation
    By k911, 1 year ago
  • refactor(configurator): Create GeneratedCollection and use in chains
    By k911, 1 year ago
  • test(commands): Test console descriptions (#16)
    By web-flow, 1 year ago
  • chore(di): Make commands lazy-loaded
    By k911, 1 year ago
  • ci(travis): Bump test swoole version to 4.2.2
    By k911, 1 year ago