PHPackages                             sidalex/swoole-app - 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. sidalex/swoole-app

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

sidalex/swoole-app
==================

a package for organizing http services on a swoole server

0.3.0(2mo ago)5236[5 issues](https://github.com/SwooleApp/SwooleApp/issues)[1 PRs](https://github.com/SwooleApp/SwooleApp/pulls)MITPHP

Since Jul 28Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/SwooleApp/SwooleApp)[ Packagist](https://packagist.org/packages/sidalex/swoole-app)[ RSS](/packages/sidalex-swoole-app/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (7)Dependencies (12)Versions (13)Used By (0)

sidalex/swoole-app
==================

[](#sidalexswoole-app)

[![Latest Stable Version](https://camo.githubusercontent.com/21f67f814574d2d6cbbcd5b70e3d69d3d9ca2f7674ab08cc2d974c638fa58b72/687474703a2f2f706f7365722e707567782e6f72672f736964616c65782f73776f6f6c652d6170702f76)](https://packagist.org/packages/sidalex/swoole-app) [![Total Downloads](https://camo.githubusercontent.com/8ce6e459533b49e2c3139af78a63ca4871c2e03f9070c3ddf3a8b4ac7e52fb20/687474703a2f2f706f7365722e707567782e6f72672f736964616c65782f73776f6f6c652d6170702f646f776e6c6f616473)](https://packagist.org/packages/sidalex/swoole-app) [![Latest Unstable Version](https://camo.githubusercontent.com/25c027f71b7f483865765ce6243fde41e178e5e4103273dcbf21a4bc9ef54dbd/687474703a2f2f706f7365722e707567782e6f72672f736964616c65782f73776f6f6c652d6170702f762f756e737461626c65)](https://packagist.org/packages/sidalex/swoole-app) [![License](https://camo.githubusercontent.com/a8513e171b5c743dcbc2c669e525546edd9bf7cb1a7d9f9bc9709d81e2416fb5/687474703a2f2f706f7365722e707567782e6f72672f736964616c65782f73776f6f6c652d6170702f6c6963656e7365)](https://packagist.org/packages/sidalex/swoole-app) [![PHP Version Require](https://camo.githubusercontent.com/113d0af79a5c63415e6b16d33858b4519446a0f76f1ccb51c8323bc9d5960b45/687474703a2f2f706f7365722e707567782e6f72672f736964616c65782f73776f6f6c652d6170702f726571756972652f706870)](https://packagist.org/packages/sidalex/swoole-app)

[en](#sidalexswoole-app-framework-for-working-with-swoole) | [ru](#sidalexswoole-app-%D1%84%D1%80%D0%B5%D0%B9%D0%BC%D0%B2%D0%BE%D1%80%D0%BA-%D0%B4%D0%BB%D1%8F-%D1%80%D0%B0%D0%B1%D0%BE%D1%82%D1%8B-%D1%81%D0%BE-swoole)

Swoole-app Framework for Working with Swoole
============================================

[](#swoole-app-framework-for-working-with-swoole)

- [Install](#install)
- [Config](#config)
- [List of config parameters](#list-of-config-parameters)
    - [.env File Format or environment variables in docker](#env-file-format-or-environment-variables-in-docker)
    - [Server Configuration](#server-configuration)
        - [Server Mode](#server-mode)
        - [Server Host and Port](#server-host-and-port)
    - [Configuration Validation](#configuration-validation)
- [Task](#task)
    - [Methods:](#methods-)
        - [task](#task-1)
        - [taskwait](#taskwait)
- [BasicTaskData](#basictaskdata)
    - [Parameters](#parameters)
- [TaskResulted](#taskresulted)
    - [Properties:](#properties-)
- [Cyclic Job](#cyclic-job)
- [Middleware](#middleware)
    - [Global Middleware](#global-middleware)
    - [Controller-specific Middleware](#controller-specific-middleware)
    - [Creating Custom Middleware](#creating-custom-middleware)
    - [Configurable Middleware](#configurable-middleware)
    - [Middleware Configuration Validation](#middleware-configuration-validation)
- [Controller](#controller)
    - [uri attribute parameter](#uri-attribute-parameter)
    - [method attribute parameter](#method-attribute-parameter)
    - [Request processing](#request-processing)
    - [Response](#response)
    - [Request](#request)
- [notFoundController](#notfoundcontroller)
- [State Containers](#state-containers)
    - [Creating a State Container](#creating-a-state-container)
    - [Accessing State Containers](#accessing-state-containers)
    - [Best Practices State Containers](#best-practices-state-containers)
- [Custom Event Handlers](#custom-event-handlers)
    - [Events](#events)
    - [Handler Format](#handler-format)
    - [Priority](#priority)
    - [Error Handling](#error-handling)
    - [Examples](#examples)

Install
-------

[](#install)

To install, execute the following commands:

```
composer require sidalex/swoole-app

```

To run the Swoole application, you need to create a script named server.php with the following content:

```
