ezimuel/ringphp
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|---|---|---|---|---|
ezimuel/guzzlestreams | 3.1.0 | 44.15 kB | MIT | prod | |
react/promise | v2.11.0 | - | MIT | prod |
Ezimuel/RingPHP is a PHP-based tool that simplifies the handling of HTTP operations. It primarily abstracts the complexities of HTTP into a single PHP function, providing a streamlined API for working with HTTP requests. A fork of the original Guzzle/RingPHP project, it provides support for both synchronous and asynchronous workflows through PHP promises. Ezimuel/RingPHP may power HTTP clients and servers which make it flexible for HTTP operations without restricting your application to a specific implementation.
Using Ezimuel/RingPHP starts by including its necessary library using the autoload in the vendor directory. A CurlHandler is then instantiated to handle the HTTP requests and responses. Here's a basic example of how you may use it:
require 'vendor/autoload.php';
use GuzzleHttp\Ring\Client\CurlHandler;
$handler = new CurlHandler();
$response = $handler([
'http_method' => 'GET',
'uri' => '/',
'headers' => [
'host' => ['www.google.com'],
'x-foo' => ['baz']
]
]);
$response->then(function (array $response) {
echo $response['status'];
});
$response->wait();
In this code, an HTTP GET request is sent to 'www.google.com' with the header 'x-foo' set to 'baz'. The response is then displayed.
For a detailed documentation on how to maximise the use of Ezimuel/RingPHP, it is provided at https://ringphp.readthedocs.io/en/latest/. This comprehensive guide contains everything you need to know about the tool, from installation to utilization for your specific application needs, all presented in a reader-friendly and comprehensible manner.