PHPackages                             lukewaite/ringphp-guzzle-handler - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. lukewaite/ringphp-guzzle-handler

ActiveLibrary[HTTP &amp; Networking](/categories/http)

lukewaite/ringphp-guzzle-handler
================================

v3.0.0(7mo ago)15355.7k↓39.3%6[1 issues](https://github.com/lukewaite/ringphp-guzzle-handler/issues)MITPHPPHP ^8.2|^8.3|^8.4CI failing

Since Jul 8Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/lukewaite/ringphp-guzzle-handler)[ Packagist](https://packagist.org/packages/lukewaite/ringphp-guzzle-handler)[ RSS](/packages/lukewaite-ringphp-guzzle-handler/feed)WikiDiscussions master Synced today

READMEChangelog (5)Dependencies (5)Versions (8)Used By (0)

RingPHP Guzzle Handler
======================

[](#ringphp-guzzle-handler)

[![Latest Version on Packagist](https://camo.githubusercontent.com/889b048f62245c5ea5a1b5564901df314f1015027d49703914f3363cfa845bbb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c756b6577616974652f72696e677068702d67757a7a6c652d68616e646c65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lukewaite/ringphp-guzzle-handler)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/95a02960759ed6bd045c256eecd5148b88c69644d470499dfe9946e9a96aed0e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c756b6577616974652f72696e677068702d67757a7a6c652d68616e646c65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lukewaite/ringphp-guzzle-handler)

Usage
-----

[](#usage)

### Installing

[](#installing)

This package can be installed with composer.

```
$ composer require lukewaite/ringphp-guzzle-handler

```

### Elasticsearch

[](#elasticsearch)

```
$guzzleHandler  = new LukeWaite\RingPhpGuzzleHandler\GuzzleHandler();

$client = Elasticsearch\ClientBuilder::create()
            ->setHandler($guzzleHandler)
            ->build();
```

Optionally, you may create a Guzzle client manually, and pass it through to the constructor:

```
$guzzle = new GuzzleHttp\Client();
$guzzleHandler  = new LukeWaite\RingPhpGuzzleHandler\GuzzleHandler($guzzle);

$client = Elasticsearch\ClientBuilder::create()
            ->setHandler($guzzleHandler)
            ->build();
```

What have you done?
-------------------

[](#what-have-you-done)

I've built a [RingPHP](https://github.com/guzzle/RingPHP) Handler that uses Guzzle as the transport.

### You've done wot mate?

[](#youve-done-wot-mate)

Yes - I built a handler for RingPHP (an older GuzzleHttp project) that uses Guzzle 6 as the transport.

### Reasoning

[](#reasoning)

The ElasticSearch PHP SDK uses the RingPHP client library under the covers. You can provide a `Handler` when creating the client, but it has to be a RingPHP handler.

NewRelic supports tracking external requests for Guzzle, but not for RingPHP. Using this handler means we can get more accurate instrumentation on our transactions.

#### Example NewRelic APM Chart, Before and After Deployment

[](#example-newrelic-apm-chart-before-and-after-deployment)

[![newrelic before and after](https://camo.githubusercontent.com/d8cddea0ad53d3d35f6de28dbd855ed55261c7308176e49fb0682af939bbfccb/68747470733a2f2f6c756b6577616974652e63612f696d616765732f323031372d30372d31352d6e657772656c69632d656c61737469637365617263682f6e657772656c69632d696e737472756d656e746174696f6e2e706e67)](https://camo.githubusercontent.com/d8cddea0ad53d3d35f6de28dbd855ed55261c7308176e49fb0682af939bbfccb/68747470733a2f2f6c756b6577616974652e63612f696d616765732f323031372d30372d31352d6e657772656c69632d656c61737469637365617263682f6e657772656c69632d696e737472756d656e746174696f6e2e706e67)

How true to RingPHP is this?
----------------------------

[](#how-true-to-ringphp-is-this)

The spec for [implementing handlers](http://ringphp.readthedocs.io/en/latest/client_handlers.html#implementing-handlers) has been followed, but in some cases I've had to go out of my way to tune this for the ElasticSearch PHP SDK.

#### $response `body`

[](#response-body)

You're supposed to be able to return a [lot of different types](http://ringphp.readthedocs.io/en/latest/spec.html#responses)here, but ElasticSearch expects it to be only a stream, so that's what we return.

#### $response `transfer_stats`

[](#response-transfer_stats)

Transfer stats is supposed to be an arbitrary array of stats provided by the handler, but it turns out ElasticSearch expects some pretty specific stuff from the default CURL handler to be in there.

###  Health Score

56

—

FairBetter than 97% of packages

Maintenance61

Regular maintenance activity

Popularity43

Moderate usage in the ecosystem

Community15

Small or concentrated contributor base

Maturity85

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 66% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~609 days

Recently: every ~762 days

Total

6

Last Release

234d ago

Major Versions

v1.0.1 → v2.0.02018-08-23

v2.2.0 → v3.0.02025-11-11

PHP version history (3 changes)v2.0.0PHP ^7.0

v2.2.0PHP &gt;=7.0

v3.0.0PHP ^8.2|^8.3|^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/134ccfc3c0d62a251b2df558f57ac2ebc918d45bc95235acd2b60ba7f251bad1?d=identicon)[lukewaite](/maintainers/lukewaite)

---

Top Contributors

[![lukewaite](https://avatars.githubusercontent.com/u/618130?v=4)](https://github.com/lukewaite "lukewaite (35 commits)")[![lukewaite-intouch](https://avatars.githubusercontent.com/u/132575883?v=4)](https://github.com/lukewaite-intouch "lukewaite-intouch (11 commits)")[![jderusse](https://avatars.githubusercontent.com/u/578547?v=4)](https://github.com/jderusse "jderusse (3 commits)")[![alcohol](https://avatars.githubusercontent.com/u/21414?v=4)](https://github.com/alcohol "alcohol (2 commits)")[![magikid](https://avatars.githubusercontent.com/u/115515?v=4)](https://github.com/magikid "magikid (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lukewaite-ringphp-guzzle-handler/health.svg)

```
[![Health](https://phpackages.com/badges/lukewaite-ringphp-guzzle-handler/health.svg)](https://phpackages.com/packages/lukewaite-ringphp-guzzle-handler)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k543.5M2.6k](/packages/aws-aws-sdk-php)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)[spatie/crawler

Crawl all internal links found on a website

2.8k18.5M67](/packages/spatie-crawler)[guzzlehttp/guzzle-services

Provides an implementation of the Guzzle Command library that uses Guzzle service descriptions to describe web services, serialize requests, and parse responses into easy to use model structures.

25711.0M191](/packages/guzzlehttp-guzzle-services)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

21866.0M1.7k](/packages/drupal-core)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6942.5M421](/packages/drupal-core-recommended)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
