1RingPHP
2=======
3
4[![Build status](https://github.com/ezimuel/ringphp/workflows/PHP%20test/badge.svg)](https://github.com/ezimuel/ringphp/actions) [![Latest Stable Version](https://poser.pugx.org/ezimuel/ringphp/v/stable)](https://packagist.org/packages/ezimuel/ringphp)
5
6**Note:** this is a fork of the original project since it was abandoned.
7
8Provides a simple API and specification that abstracts away the details of HTTP
9into a single PHP function. RingPHP be used to power HTTP clients and servers
10through a PHP function that accepts a request hash and returns a response hash
11that is fulfilled using a [promise](https://github.com/reactphp/promise),
12allowing RingPHP to support both synchronous and asynchronous workflows.
13
14By abstracting the implementation details of different HTTP clients and
15servers, RingPHP allows you to utilize pluggable HTTP clients and servers
16without tying your application to a specific implementation.
17
18```php
19require 'vendor/autoload.php';
20
21use GuzzleHttp\Ring\Client\CurlHandler;
22
23$handler = new CurlHandler();
24$response = $handler([
25    'http_method' => 'GET',
26    'uri'         => '/',
27    'headers'     => [
28        'host'  => ['www.google.com'],
29        'x-foo' => ['baz']
30    ]
31]);
32
33$response->then(function (array $response) {
34    echo $response['status'];
35});
36
37$response->wait();
38```
39
40RingPHP is inspired by Clojure's [Ring](https://github.com/ring-clojure/ring),
41which, in turn, was inspired by Python's WSGI and Ruby's Rack. RingPHP is
42utilized as the handler layer in [Guzzle](https://guzzlephp.org) 5.0+ to send
43HTTP requests.
44
45Documentation
46-------------
47
48See https://ringphp.readthedocs.io/en/latest/ for the full online documentation.
49