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

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

middlewares/debugbar
====================

Middleware to insert PHP DebugBar automatically in html responses

v2.2.0(1y ago)1722.9k↓75.6%66MITPHPPHP ^7.2 || ^8.0CI failing

Since Oct 8Pushed 1y ago1 watchersCompare

[ Source](https://github.com/middlewares/debugbar)[ Packagist](https://packagist.org/packages/middlewares/debugbar)[ Docs](https://github.com/middlewares/debugbar)[ RSS](/packages/middlewares-debugbar/feed)WikiDiscussions master Synced yesterday

READMEChangelog (10)Dependencies (9)Versions (17)Used By (6)

middlewares/debugbar
====================

[](#middlewaresdebugbar)

[![Latest Version on Packagist](https://camo.githubusercontent.com/d0061e2017245a19b3ad4e5f5160c45ec6e02c0dd83607e712e460c665c14f6f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6964646c6577617265732f64656275676261722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/middlewares/debugbar)[![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/middlewares/debugbar)

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

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

[](#requirements)

- PHP &gt;= 7.2
- A [PSR-7 http library](https://github.com/middlewares/awesome-psr15-middlewares#psr-7-implementations)
- A [PSR-15 middleware dispatcher](https://github.com/middlewares/awesome-psr15-middlewares#dispatcher)

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

[](#installation)

This package is installable and autoloadable via Composer as [middlewares/debugbar](https://packagist.org/packages/middlewares/debugbar).

```
composer require middlewares/debugbar
```

Example
-------

[](#example)

```
$dispatcher = new Dispatcher([
	new Middlewares\Debugbar()
]);

$response = $dispatcher->dispatch(new ServerRequest());
```

Usage
-----

[](#usage)

You can provide a `DebugBar\DebugBar` instance to the constructor or an instance of `DebugBar\StandardDebugBar` will be created automatically. Optionally, you can provide a `Psr\Http\Message\ResponseFactoryInterface` and `Psr\Http\Message\StreamFactoryInterface` to create the new responses. If it's not defined, [Middleware\\Utils\\Factory](https://github.com/middlewares/utils#factory) will be used to detect it automatically.

```
//Create a StandardDebugBar automatically
$debugbar = new Middlewares\Debugbar();

//Use other Debugbar instance
$debugbar = new Middlewares\Debugbar($myDebugbar);

//Use other Debugbar instance and PSR-17 factories
$debugbar = new Middlewares\Debugbar($myDebugbar, $myResponseFactory, $myStreamFactory);
```

### captureAjax

[](#captureajax)

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.

```
$debugbar = (new Middlewares\Debugbar())->captureAjax();
```

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

```
$debugbar = (new Middlewares\Debugbar())->inline();
```

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

```
$debugbar = (new Middlewares\Debugbar())->renderOptions(array('base_url' => "/MyProjectsSubDirectory/php-debugbar/php-debugbar"));
```

---

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

48

—

FairBetter than 93% of packages

Maintenance42

Moderate activity, may be stable

Popularity36

Limited adoption so far

Community24

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor1

Top contributor holds 73.4% 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 ~206 days

Recently: every ~393 days

Total

16

Last Release

467d ago

Major Versions

v0.5.0 → v1.0.02018-01-25

v1.1.0 → v2.0.02019-11-30

PHP version history (4 changes)v0.1.0PHP ^5.6 || ^7.0

v0.5.0PHP ^7.0

v2.0.0PHP ^7.2

v2.0.1PHP ^7.2 || ^8.0

### Community

Maintainers

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

![](https://www.gravatar.com/avatar/42e0d72f42eb7d84f67e20d28606da42e5a3248ca908b1eadb4366aafeae2561?d=identicon)[filisko](/maintainers/filisko)

---

Top Contributors

[![oscarotero](https://avatars.githubusercontent.com/u/377873?v=4)](https://github.com/oscarotero "oscarotero (58 commits)")[![filisko](https://avatars.githubusercontent.com/u/8798694?v=4)](https://github.com/filisko "filisko (9 commits)")[![rvm-peercode](https://avatars.githubusercontent.com/u/132886951?v=4)](https://github.com/rvm-peercode "rvm-peercode (6 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

debugbardebuggerhttpmiddlewarepsr-15httppsr-7middlewaredebugbarserverpsr-15

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[mezzio/mezzio

PSR-15 Middleware Microframework

3923.8M125](/packages/mezzio-mezzio)[middlewares/request-handler

Middleware to execute request handlers

451.8M30](/packages/middlewares-request-handler)[middlewares/fast-route

Middleware to use FastRoute

98205.1k15](/packages/middlewares-fast-route)[middlewares/negotiation

Middleware to implement content negotiation

46458.6k11](/packages/middlewares-negotiation)[middlewares/payload

Middleware to parse the body of the request with support for json, csv and url-encode

33472.0k17](/packages/middlewares-payload)[middlewares/http-authentication

Middleware to implement Basic and Digest Http authentication

34306.4k2](/packages/middlewares-http-authentication)

PHPackages © 2026

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