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(4mo ago)08.4k↓35.4%MITPHPPHP ^7.4 || ^8.0

Since Aug 15Pushed 4mo 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 1mo ago

READMEChangelog (10)Dependencies (15)Versions (13)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

44

—

FairBetter than 92% of packages

Maintenance74

Regular maintenance activity

Popularity24

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity55

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 ~78 days

Recently: every ~168 days

Total

12

Last Release

147d ago

Major Versions

0.1.0 → 1.0.02023-08-21

### 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

[mezzio/mezzio

PSR-15 Middleware Microframework

3883.6M97](/packages/mezzio-mezzio)[mezzio/mezzio-authentication-oauth2

OAuth2 (server) authentication middleware for Mezzio and PSR-7 applications.

28483.0k2](/packages/mezzio-mezzio-authentication-oauth2)[mezzio/mezzio-authentication

Authentication middleware for Mezzio and PSR-7 applications

121.6M26](/packages/mezzio-mezzio-authentication)[middlewares/utils

Common utils for PSR-15 middleware packages

503.4M92](/packages/middlewares-utils)[middlewares/request-handler

Middleware to execute request handlers

451.6M26](/packages/middlewares-request-handler)[middlewares/debugbar

Middleware to insert PHP DebugBar automatically in html responses

1822.1k7](/packages/middlewares-debugbar)

PHPackages © 2026

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