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(6mo ago)15352.3k↓38.2%6[1 issues](https://github.com/lukewaite/ringphp-guzzle-handler/issues)MITPHPPHP ^8.2|^8.3|^8.4CI passing

Since Jul 8Pushed 6mo 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 1mo ago

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

57

—

FairBetter than 98% of packages

Maintenance67

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

188d 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

[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[shopify/shopify-api

Shopify API Library for PHP

4634.8M16](/packages/shopify-shopify-api)[onesignal/onesignal-php-api

A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com

34170.2k2](/packages/onesignal-onesignal-php-api)[zenditplatform/zendit-php-sdk

PHP client for Zendit API

1204.3k](/packages/zenditplatform-zendit-php-sdk)[huaweicloud/huaweicloud-sdk-php

Huawei Cloud SDK for PHP

1829.2k2](/packages/huaweicloud-huaweicloud-sdk-php)[ory/hydra-client-php

Documentation for all of Ory Hydra's APIs.

1710.8k](/packages/ory-hydra-client-php)

PHPackages © 2026

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