• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..11-Jun-2021-

docs/H11-Jun-2021-1,123856

src/H11-Jun-2021-2,3071,512

tests/H11-Jun-2021-2,7462,366

.editorconfigH A D10-Jun-2021185 1310

.travis.ymlH A D10-Jun-2021913 4435

CHANGELOG.mdH A D10-Jun-20212.8 KiB11964

LICENSEH A D10-Jun-20211.1 KiB2016

MakefileH A D10-Jun-2021899 4735

README.rstH A D10-Jun-20211.4 KiB4735

composer.jsonH A D10-Jun-20211 KiB4443

phpunit.xml.distH A D10-Jun-2021355 1514

README.rst

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