swoolefony/swoole-bundle

A Swoole bundle for Symfony.

Installs: 35

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 2

Forks: 0

Open Issues: 0

Type:symfony-bundle

dev-main 2023-08-20 14:56 UTC

This package is auto-updated.

Last update: 2024-12-20 17:40:04 UTC


README

Swoolefony is a Swoole bundle for Symfony. It provides integration via a runtime class and management via commands.

Installation

Install it using composer:

composer require swoolefony/swoole-bundle

Runtime Configuration

Add the runtime class to your composer.json in the extra section:

"extra": {
    "runtime": {
        "class": "Swoolefony\\SwooleBundle\\Runtime\\SwooleRuntime"
    }
}

With the runtime in place, the default public/index.php would be the entry point for start the application. Once it is run, the Swoole server is started based on the provided configuration.

Swoole Configuration

The Swoole server mode, IP, and port can be controlled via environment variables:

The runtime class will look for those environment variables and use them if they exist. Otherwise it will fallback to the default values that are listed.

Request Attributes

The following attributes are available on the request class (Request->attributes) when it is processed by Symfony:

Container Services

The following container services are available: