An open API service indexing awesome lists of open source software.

https://github.com/indragunawan/swoole-http-message-bridge

Provides integration Swoole Http Request / Response to Symfony Request / Response.
https://github.com/indragunawan/swoole-http-message-bridge

swoole swoole-http symfony-bridge

Last synced: 19 days ago
JSON representation

Provides integration Swoole Http Request / Response to Symfony Request / Response.

Awesome Lists containing this project

README

        

# Swoole Http Message Bridge

[![license](https://img.shields.io/github/license/IndraGunawan/swoole-http-message-bridge.svg?style=flat-square)](https://github.com/IndraGunawan/swoole-http-message-bridge/blob/master/LICENSE)
[![Source](https://img.shields.io/badge/source-IndraGunawan%2Fswoole--http--message--bridge-blue.svg)](https://github.com/IndraGunawan/swoole-http-message-bridge)
[![Packagist](https://img.shields.io/badge/packagist-indragunawan%2Fswoole--http--message--bridge-blue.svg)](https://packagist.org/packages/indragunawan/swoole-http-message-bridge)
[![Travis](https://img.shields.io/travis/IndraGunawan/swoole-http-message-bridge.svg?style=flat-square)](https://travis-ci.org/IndraGunawan/swoole-http-message-bridge)

Provides integration Swoole Http Request / Response to Symfony Request / Response.

## Installation

Require the package with composer. (`indragunawan/api-rate-limit-bundle` on [Packagist](https://packagist.org/packages/indragunawan/swoole-http-message-bridge));
```bash
composer require indragunawan/swoole-http-message-bridge
```

## Usage

### Symfony Request and Response

```php
on('request', function (swoole_http_request $request, swoole_http_response $response) {
$sfRequest = Request::createFromSwooleRequest($request);
// ...
// $sfResponse = run_something_here that return Symfony response
Response::writeSwooleResponse($response, $sfResponse);
// ...
$response->end();
});

$http->start();
```