PHPackages                             mostafasy/mezzio-debugbar - 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. mostafasy/mezzio-debugbar

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

mostafasy/mezzio-debugbar
=========================

Middleware to insert PHP DebugBar automatically in html responses

1.4.0(7mo ago)09.7k↓62.5%MITPHPPHP ^7.4 || ^8.0

Since Aug 15Pushed 2w agoCompare

[ Source](https://github.com/mostafasy/mezzio-debugbar)[ Packagist](https://packagist.org/packages/mostafasy/mezzio-debugbar)[ Docs](https://github.com/mostafasy/mezzio-debugbar)[ RSS](/packages/mostafasy-mezzio-debugbar/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (10)Dependencies (15)Versions (14)Used By (0)

-forked from :

-forked from :

mezzio/debugbar
===============

[](#mezziodebugbar)

[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Testing](https://github.com/middlewares/debugbar/workflows/testing/badge.svg)](https://github.com/middlewares/debugbar/workflows/testing/badge.svg)[![Total Downloads](https://camo.githubusercontent.com/7dee6bacafab5df67dd1569cbf9889cdbb9eb13d1728c7bd33d28c9f109d5483/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6964646c6577617265732f64656275676261722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mostafasy/mezzio-debugbar)

Middleware to insert [PHP DebugBar](http://phpdebugbar.com) automatically in html responses for Mezzio Framwork.

Requirements
------------

[](#requirements)

- PHP &gt;= 7.4

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

[](#installation)

```
composer require --dev mostafasy/mezzio-debugbar

```

Example
-------

[](#example)

This package supplies a config provider, which could be added to your config/config.php when using laminas-config-aggregator or mezzio-config-manager. However, because it should only be enabled in development, we recommend creating a "local" configuration file (e.g., config/autoload/php-debugbar.local.php) when you need to enable it, with the following contents:

```
use DebugBar\Bridge\DoctrineCollector;
use DebugBar\Storage\FileStorage;
use Laminas\ConfigAggregator\ConfigAggregator;
use Laminas\Stdlib\ArrayUtils;

$aggregator = new ConfigAggregator(
    [
        Mezzio\DebugBar\ConfigProvider::class,
    ]
);
return ArrayUtils::merge(
    $aggregator->getMergedConfig(),
    [
// here you can overload the default Values .as example add doctrine collector or fileStorage
        'debugbar'     => [
            'disable'    => false,
            'captureAjax' => true,
            'collectors' => [
                DoctrineCollector::class,
            ],
            'storage'    => FileStorage::class,
            'storage_dir' =>'path/to-your-storage-dir'
        ],
    ]
);
```

### Disable config

[](#disable-config)

Sometimes you want to have control when enable or disable PHP Debug Bar:

- We allow you to disable attaching phpdebugbar using X-Disable-Debug-Bar: true header, cookie or request attribute.
- or you can configure in config:

```
'disable'=>true

```

### captureAjax conifg

[](#captureajax-conifg)

Use this option to capture ajax requests and send the data in the headers. [More info about AJAX and Stacked data](http://phpdebugbar.com/docs/ajax-and-stack.html#ajax-and-stacked-data). By default it's disabled.

### inline

[](#inline)

Set true to dump the js/css code inline in the html. This fixes (or mitigate) some issues related with loading the debugbar assets.

### renderOptions

[](#renderoptions)

Use this option to pass render options to the debugbar as an array. A list of available options can be found at

An example usage would be to pass a new location for the `base_url` so that you can rewrite the location of the files needed to render the debug bar. This can be used with symlinks, .htaccess or routes to the files to ensure the debugbar files are accessible.

### File Storage

[](#file-storage)

It will collect data as json files under the specified directory (which has to be writable).you can configure as :

```
'storage'    => FileStorage::class,
'storage_dir' =>'path/to-your-storage-dir'

```

pdo Storage
-----------

[](#pdo-storage)

It will collect data and saved to database you can configure as :

```
'storage'    => PdoStorage::class,
'pdo' =>[
  'dsn'=>'mysql:dbname=testdb;host=127.0.0.1';',
  'username'=>'dbuser',
  'password'=>'dbpass',
],

```

please note you have to execute sql schema [pdo-sql-Schema](https://github.com/mostafasy/mezzio-debugbar/blob/master/src/Storage/DatabaseSchemaSql/pdo_storge_sql_schema.sql)

Doctrine Storage
----------------

[](#doctrine-storage)

It will collect data and saved to database by using Doctine you can configure as :

```
'storage'    => DoctrineStorage::class,
  'doctrine_storage'=>[
    // it will save queries into extra table for analysis purpose.by default it is false.
    'save_sql_queries_to_extra_table' => true,
    ],

```

you have to execute sql schema: [doctrine-sql-Schema](https://github.com/mostafasy/mezzio-debugbar/blob/master/src/Storage/DatabaseSchemaSql/doctrine_storge_sql_schema.sql)

---

Route Colloctor
---------------

[](#route-colloctor)

It will collect the Route Informations. we can add the collectors to config as the following:

```
  'collectors' => [
                RouteCollector::class,
            ],

```

Example of Route config:

```
 'routes' => [
        [
            'path' => '/path/to/match',
            'middleware' => 'Middleware service or pipeline',
            'allowed_methods' => ['GET', 'POST', 'PATCH'],
            'name' => 'route.name',
            'options' => [
                'stuff' => 'to',
                'pass'  => 'to',
                'the'   => 'underlying router',
            ],
        ],
        'another.route.name' => [
            'path' => '/another/path/to/match',
            'middleware' => 'Middleware service or pipeline',
            'allowed_methods' => ['GET', 'POST'],
            'options' => [
                'more'    => 'router',
                'options' => 'here',
            ],
        ],
    ],

```

---

Please see [CHANGELOG](CHANGELOG.md) for more information about recent changes and [CONTRIBUTING](CONTRIBUTING.md) for contributing details.

The MIT License (MIT). Please see [LICENSE](LICENSE) for more information.

###  Health Score

46

—

FairBetter than 92% of packages

Maintenance81

Actively maintained with recent releases

Popularity24

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 58.2% 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 ~89 days

Recently: every ~171 days

Total

13

Last Release

19d ago

Major Versions

0.1.0 → 1.0.02023-08-21

1.4.0 → 2.0.x-dev2026-07-29

PHP version history (2 changes)0.0.1PHP ^7.4 || ^8.0

2.0.x-devPHP ^8.0

### Community

Maintainers

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

---

Top Contributors

[![oscarotero](https://avatars.githubusercontent.com/u/377873?v=4)](https://github.com/oscarotero "oscarotero (53 commits)")[![mostafasy](https://avatars.githubusercontent.com/u/16436337?v=4)](https://github.com/mostafasy "mostafasy (32 commits)")[![mav2287](https://avatars.githubusercontent.com/u/13509635?v=4)](https://github.com/mav2287 "mav2287 (4 commits)")[![ajgarlag](https://avatars.githubusercontent.com/u/388184?v=4)](https://github.com/ajgarlag "ajgarlag (2 commits)")

---

Tags

httppsr-7middlewaredebugbarserverpsr-15

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/mostafasy-mezzio-debugbar/health.svg)

```
[![Health](https://phpackages.com/badges/mostafasy-mezzio-debugbar/health.svg)](https://phpackages.com/packages/mostafasy-mezzio-debugbar)
```

###  Alternatives

[cakephp/cakephp

The CakePHP framework

8.9k20.0M1.9k](/packages/cakephp-cakephp)[tempest/framework

The PHP framework that gets out of your way.

2.3k37.6k21](/packages/tempest-framework)[guzzlehttp/psr7

PSR-7 message implementation that also provides common utility methods

7.9k1.1B4.4k](/packages/guzzlehttp-psr7)[sunrise/http-router

A powerful solution as the foundation of your project.

16852.3k12](/packages/sunrise-http-router)[typo3/cms

TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.

1.2k1.9M122](/packages/typo3-cms)[typo3/cms-core

TYPO3 CMS Core

3313.6M5.6k](/packages/typo3-cms-core)

PHPackages © 2026

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