https://github.com/chubbyphp/chubbyphp-swoole-request-handler
A request handler adapter for swoole, using PSR-7, PSR-15 and PSR-17.
https://github.com/chubbyphp/chubbyphp-swoole-request-handler
chubbyphp psr-15 psr-17 psr-7 request-handler swoole
Last synced: 2 days ago
JSON representation
A request handler adapter for swoole, using PSR-7, PSR-15 and PSR-17.
- Host: GitHub
- URL: https://github.com/chubbyphp/chubbyphp-swoole-request-handler
- Owner: chubbyphp
- License: mit
- Created: 2019-07-28T17:39:17.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-03-12T14:09:14.000Z (about 1 month ago)
- Last Synced: 2025-04-10T18:07:22.387Z (6 days ago)
- Topics: chubbyphp, psr-15, psr-17, psr-7, request-handler, swoole
- Language: PHP
- Homepage:
- Size: 94.7 KB
- Stars: 27
- Watchers: 3
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-swoole - chubbyphp/chubbyphp-swoole-request-handler - A request handler adapter for Swoole, using PSR-7, PSR-15 and PSR-17. (HTTP and WebSocket)
- awesome-swoole - chubbyphp-swoole-request-handler - A request handler adapter for swoole, using PSR-7, PSR-15 and PSR-17. (Integration)
README
# chubbyphp-swoole-request-handler
[](https://github.com/chubbyphp/chubbyphp-swoole-request-handler/actions/workflows/ci.yml)
[](https://coveralls.io/github/chubbyphp/chubbyphp-swoole-request-handler?branch=master)
[](https://dashboard.stryker-mutator.io/reports/github.com/chubbyphp/chubbyphp-swoole-request-handler/master)
[](https://packagist.org/packages/chubbyphp/chubbyphp-swoole-request-handler)
[](https://packagist.org/packages/chubbyphp/chubbyphp-swoole-request-handler)
[](https://packagist.org/packages/chubbyphp/chubbyphp-swoole-request-handler)[](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-swoole-request-handler)
[](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-swoole-request-handler)
[](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-swoole-request-handler)
[](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-swoole-request-handler)
[](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-swoole-request-handler)
[](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-swoole-request-handler)
[](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-swoole-request-handler)
[](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-swoole-request-handler)
[](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-swoole-request-handler)
[](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-swoole-request-handler)
[](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-swoole-request-handler)## Description
A request handler adapter for swoole, using PSR-7, PSR-15 and PSR-17.
## Requirements
* php: ^8.2
* [ext-swoole][2]: ^5.1.7|^6.0
* [dflydev/fig-cookies][3]: ^3.1
* [psr/http-factory][4]: ^1.1
* [psr/http-message][5]: ^1.1|^2.0
* [psr/http-server-handler][6]: ^1.0.2
* [psr/log][7]: ^2.0|^3.0.2## Installation
Through [Composer](http://getcomposer.org) as [chubbyphp/chubbyphp-swoole-request-handler][1].
```sh
composer require chubbyphp/chubbyphp-swoole-request-handler "^1.5"
```## Usage
```php
on('start', function (Server $server): void {
echo 'Swoole http server is started at http://0.0.0.0:8080'.PHP_EOL;
});$http->on('request', new OnRequest(
new PsrRequestFactory(
new ServerRequestFactory(),
new StreamFactory(),
new UploadedFileFactory()
),
new SwooleResponseEmitter(),
$app
));$http->start();
```### with blackfire
```php
on('request', $onRequest);
```### with newrelic
```php
on('request', $onRequest);
```## Copyright
2025 Dominik Zogg
[1]: https://packagist.org/packages/chubbyphp/chubbyphp-swoole-request-handler
[2]: https://www.swoole.co.uk
[3]: https://packagist.org/packages/dflydev/fig-cookies
[4]: https://packagist.org/packages/psr/http-factory
[5]: https://packagist.org/packages/psr/http-message
[6]: https://packagist.org/packages/psr/http-server-handler
[7]: https://packagist.org/packages/psr/log