PHPackages                             playbloom/guzzle-bundle - 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. playbloom/guzzle-bundle

ActiveSymfony-bundle[HTTP &amp; Networking](/categories/http)

playbloom/guzzle-bundle
=======================

Provide Symfony2 web profiler for Guzzle

v2.0.0(6mo ago)82311.0k↓37.5%22[2 issues](https://github.com/ludofleury/GuzzleBundle/issues)1MITPHPPHP &gt;=7.1.0CI passing

Since Nov 3Pushed 6mo ago5 watchersCompare

[ Source](https://github.com/ludofleury/GuzzleBundle)[ Packagist](https://packagist.org/packages/playbloom/guzzle-bundle)[ Docs](https://github.com/ludofleury/GuzzleBundle)[ RSS](/packages/playbloom-guzzle-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (10)Versions (12)Used By (1)

Guzzle Bundle [![Build Status](https://github.com/ludofleury/GuzzleBundle/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/ludofleury/GuzzleBundle/actions/workflows/tests.yml) [![Latest Stable Version](https://camo.githubusercontent.com/b76a04f5943a091fbc2815b651e8fd8e6310773f552f8218399e310ac3a86790/68747470733a2f2f706f7365722e707567782e6f72672f706c6179626c6f6f6d2f67757a7a6c652d62756e646c652f762f737461626c652e706e67)](https://packagist.org/packages/playbloom/guzzle-bundle) [![Total Downloads](https://camo.githubusercontent.com/be0f6af6f51b61f67da07a468e7c8307cc6a74e7855597879c93833bc572b33d/68747470733a2f2f706f7365722e707567782e6f72672f706c6179626c6f6f6d2f67757a7a6c652d62756e646c652f646f776e6c6f6164732e706e67)](https://packagist.org/packages/playbloom/guzzle-bundle)
=================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#guzzle-bundle---)

Provide a basic logger and an advanced profiler for Guzzle with support for multiple Guzzle versions.

- The basic logger uses the default Symfony app logger, it's safe to use in your production environment.
- The advanced profiler is for debug purposes and will display a dedicated report available in the toolbar and Symfony Web Profiler
- **Multi-version support**: Automatically detects and works with Guzzle 4.x, 5.x, 6.x, and 7.x

[![Guzzle Symfony web profiler panel](https://camo.githubusercontent.com/9233749376143cfd40244d919cd9d3eca0d0cc50ef6ffd430255eb0cacf5ef76/687474703a2f2f6c75646f666c657572792e6769746875622e696f2f47757a7a6c6542756e646c652f696d616765732f67757a7a6c652d70726f66696c65722d70616e656c2e706e67)](https://camo.githubusercontent.com/9233749376143cfd40244d919cd9d3eca0d0cc50ef6ffd430255eb0cacf5ef76/687474703a2f2f6c75646f666c657572792e6769746875622e696f2f47757a7a6c6542756e646c652f696d616765732f67757a7a6c652d70726f66696c65722d70616e656c2e706e67)

[![Guzzle Symfony web profiler panel - request details](https://camo.githubusercontent.com/6fd8399ca8772f21e563fb9f9b2b73997541c67c3b5386f928589265ed1e3e10/687474703a2f2f6c75646f666c657572792e6769746875622e696f2f47757a7a6c6542756e646c652f696d616765732f67757a7a6c652d726571756573742d64657461696c2e706e67)](https://camo.githubusercontent.com/6fd8399ca8772f21e563fb9f9b2b73997541c67c3b5386f928589265ed1e3e10/687474703a2f2f6c75646f666c657572792e6769746875622e696f2f47757a7a6c6542756e646c652f696d616765732f67757a7a6c652d726571756573742d64657461696c2e706e67)

[![Guzzle Symfony web profiler panel - response details](https://camo.githubusercontent.com/3814ff9304564a72a2f45abee1619aa9faab22e2124cae2503bc20d07b82b641/687474703a2f2f6c75646f666c657572792e6769746875622e696f2f47757a7a6c6542756e646c652f696d616765732f67757a7a6c652d726573706f6e73652d64657461696c2e706e67)](https://camo.githubusercontent.com/3814ff9304564a72a2f45abee1619aa9faab22e2124cae2503bc20d07b82b641/687474703a2f2f6c75646f666c657572792e6769746875622e696f2f47757a7a6c6542756e646c652f696d616765732f67757a7a6c652d726573706f6e73652d64657461696c2e706e67)

Supported Guzzle Versions
-------------------------

[](#supported-guzzle-versions)

This bundle supports the following Guzzle versions:

- **Guzzle 4.x** (`guzzlehttp/guzzle:~4.0`)
- **Guzzle 5.x** (`guzzlehttp/guzzle:~5.0`)
- **Guzzle 6.x** (`guzzlehttp/guzzle:~6.0`)
- **Guzzle 7.x** (`guzzlehttp/guzzle:~7.0`)

The bundle automatically detects which version you have installed and adapts accordingly.

Installation
------------

[](#installation)

```
composer require --dev playbloom/guzzle-bundle
```

Add the bundle to your Symfony app kernel

```

```

To enable the advanced profiler &amp; the toolbar/web profiler panel, add this line to your `app/config/config_dev.yml`

```
playbloom_guzzle:
    web_profiler: true
```

### Guzzle client as a Symfony service

[](#guzzle-client-as-a-symfony-service)

Concrete [Guzzle client creation](http://guzzle.readthedocs.org/en/latest/clients.html#creating-a-client) can be easily managed by the Symfony service container thanks to a [simple factory configuration](http://symfony.com/doc/current/components/dependency_injection/factories.html), in this case, you just need to tag your guzzle service(s) with `playbloom_guzzle.client`.

**Automatic plugin attachment** via service tags works for all Guzzle versions (4, 5, 6, and 7). It will add the basic logger to your client(s). If the web\_profiler is enabled in the current environment, it will also add the advanced profiler and display report on the Symfony toolbar/web profiler.

```
# config/services.yaml
services:
    acme.client:
        class: '%acme.client.class%'
        factory: ['%acme.client.class%', 'factory']
        tags: ['playbloom_guzzle.client']
```

### Add the logger/profiler manually to a Guzzle client

[](#add-the-loggerprofiler-manually-to-a-guzzle-client)

If you need to handle the registration of the logger or profiler manually, you can retrieve these services from the Symfony container. The bundle automatically registers the correct service based on your Guzzle version.

#### For Guzzle 4 and 5

[](#for-guzzle-4-and-5)

```
use GuzzleHttp\Client;

$client = new Client(['base_url' => 'https://api.example.com']);

$logger = $container->get('playbloom_guzzle.client.plugin.subscriber.logger');
$client->getEmitter()->attach($logger);

$profiler = $container->get('playbloom_guzzle.client.plugin.subscriber.profiler');
$client->getEmitter()->attach($profiler);
```

#### For Guzzle 6+

[](#for-guzzle-6)

```
use GuzzleHttp\Client;
use GuzzleHttp\HandlerStack;

$stack = HandlerStack::create();

$logger = $container->get('playbloom_guzzle.client.plugin.middleware.logger');
$stack->push($logger);

$profiler = $container->get('playbloom_guzzle.client.plugin.middleware.profiler');
$stack->push($profiler);

$client = new Client([
    'base_uri' => 'https://api.example.com',
    'handler' => $stack
]);
```

Customize your own profiler panel
---------------------------------

[](#customize-your-own-profiler-panel)

If you need a [custom profiler panel](http://symfony.com/doc/master/cookbook/profiler/data_collector.html) you can extend/reuse easily the data collector and profiler template from this bundle.

For example, you have a GithubBundle which interact with the Github API. You also have a Github profiler panel to debug your developement and you want to have the API requests profiled in this panel.

It's quite easy: First, define your own `GithubDataCollector` extending the `Playbloom\Bundle\GuzzleBundle\DataCollector\GuzzleDataCollector`

Then extends the guzzle web profiler template

```
{% extends 'PlaybloomGuzzleBundle:Collector:guzzle.html.twig' %}

{% block panel %}

        Github

            Github API key: {{ collector.getApiKey }}

    {% include 'PlaybloomGuzzleBundle:Profiler:requests.html.twig' with {'requests': collector.requests } %}
{% endblock %}
```

And finally declare your data collector

```
# config/services.yaml
services:
    data_collector.github:
        class: Acme\GithubBundle\DataCollector\GithubDataCollector
        arguments:
            - '@playbloom_guzzle.client.plugin.profiler'
        tags:
            - { name: data_collector, template: '@AcmeGithub/Collector/github.html.twig', id: github }
```

That's it, now your profiler panel displays your custom information and the Guzzle API requests.

TODO
----

[](#todo)

- Add extra information about the client configuration itself (thanks to the guzzle service builder?)
- Add clients|host|endpoint|time filters for http requests

Licence
-------

[](#licence)

This bundle is under the MIT license. See the complete license in the bundle

Credits
-------

[](#credits)

- Swagger for the UI

###  Health Score

54

—

FairBetter than 97% of packages

Maintenance67

Regular maintenance activity

Popularity46

Moderate usage in the ecosystem

Community26

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 65.7% 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 ~487 days

Recently: every ~957 days

Total

10

Last Release

194d ago

Major Versions

v1.4.0 → v2.0.02025-11-05

PHP version history (3 changes)v1.0.0PHP &gt;=5.3.0

v1.2.0PHP &gt;=5.6

v2.0.0PHP &gt;=7.1.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/e893ccc6f340d86cfafd86f52bb79a424bcf85377d88026eb7924a26ad8d3636?d=identicon)[ludofleury](/maintainers/ludofleury)

---

Top Contributors

[![ludofleury](https://avatars.githubusercontent.com/u/187038?v=4)](https://github.com/ludofleury "ludofleury (46 commits)")[![turanmahmudov](https://avatars.githubusercontent.com/u/3330881?v=4)](https://github.com/turanmahmudov "turanmahmudov (5 commits)")[![PReimers](https://avatars.githubusercontent.com/u/1785288?v=4)](https://github.com/PReimers "PReimers (5 commits)")[![DZunke](https://avatars.githubusercontent.com/u/1244235?v=4)](https://github.com/DZunke "DZunke (3 commits)")[![nicodemuz](https://avatars.githubusercontent.com/u/1620454?v=4)](https://github.com/nicodemuz "nicodemuz (2 commits)")[![agallou](https://avatars.githubusercontent.com/u/320372?v=4)](https://github.com/agallou "agallou (2 commits)")[![BenoitLeveque](https://avatars.githubusercontent.com/u/242870?v=4)](https://github.com/BenoitLeveque "BenoitLeveque (1 commits)")[![Nyholm](https://avatars.githubusercontent.com/u/1275206?v=4)](https://github.com/Nyholm "Nyholm (1 commits)")[![pschultz](https://avatars.githubusercontent.com/u/607733?v=4)](https://github.com/pschultz "pschultz (1 commits)")[![srogier](https://avatars.githubusercontent.com/u/814069?v=4)](https://github.com/srogier "srogier (1 commits)")[![bitdeli-chef](https://avatars.githubusercontent.com/u/3092978?v=4)](https://github.com/bitdeli-chef "bitdeli-chef (1 commits)")[![geoffreytran](https://avatars.githubusercontent.com/u/544500?v=4)](https://github.com/geoffreytran "geoffreytran (1 commits)")[![gigablah](https://avatars.githubusercontent.com/u/471275?v=4)](https://github.com/gigablah "gigablah (1 commits)")

---

Tags

profilerGuzzleSymfony2

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/playbloom-guzzle-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/playbloom-guzzle-bundle/health.svg)](https://phpackages.com/packages/playbloom-guzzle-bundle)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[nelmio/api-doc-bundle

Generates documentation for your REST API from attributes

2.3k63.6M233](/packages/nelmio-api-doc-bundle)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[drupal/core

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

19562.3M1.3k](/packages/drupal-core)

PHPackages © 2026

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