PHPackages                             dotkernel/dot-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. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. dotkernel/dot-debugbar

ActiveLibrary[Debugging &amp; Profiling](/categories/debugging)

dotkernel/dot-debugbar
======================

Dotkernel's debug bar built on top of maximebf/debugbar

1.3.0(1y ago)52.7k↓25%1[5 issues](https://github.com/dotkernel/dot-debugbar/issues)MITJavaScriptPHP ~8.1.0 || ~8.2.0 || ~8.3.0CI passing

Since Jan 7Pushed 1y ago2 watchersCompare

[ Source](https://github.com/dotkernel/dot-debugbar)[ Packagist](https://packagist.org/packages/dotkernel/dot-debugbar)[ Docs](https://github.com/dotkernel/dot-debugbar)[ RSS](/packages/dotkernel-dot-debugbar/feed)WikiDiscussions 1.0 Synced 1mo ago

READMEChangelog (10)Dependencies (13)Versions (19)Used By (0)

dot-debugbar
============

[](#dot-debugbar)

Dotkernel's debug bar component

> dot-debugbar is a wrapper on top of [maximebf/php-debugbar](https://github.com/maximebf/php-debugbar)

Documentation
-------------

[](#documentation)

Documentation is available at: .

Badges
------

[](#badges)

[![OSS Lifecycle](https://camo.githubusercontent.com/9fa24a720f3fb521d002ef0722959e01173e59ba365a8fe725226a44190553c2/68747470733a2f2f696d672e736869656c64732e696f2f6f73736c6966656379636c652f646f746b65726e656c2f646f742d6465627567626172)](https://camo.githubusercontent.com/9fa24a720f3fb521d002ef0722959e01173e59ba365a8fe725226a44190553c2/68747470733a2f2f696d672e736869656c64732e696f2f6f73736c6966656379636c652f646f746b65726e656c2f646f742d6465627567626172)[![PHP from Packagist (specify version)](https://camo.githubusercontent.com/b4ef5d355940aff4e767bd5f3aeba9db5f469577e5009fea762689cd1eb83aca/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f646f746b65726e656c2f646f742d64656275676261722f312e332e30)](https://camo.githubusercontent.com/b4ef5d355940aff4e767bd5f3aeba9db5f469577e5009fea762689cd1eb83aca/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f646f746b65726e656c2f646f742d64656275676261722f312e332e30)

[![GitHub issues](https://camo.githubusercontent.com/a081a7dcd6bb52158c2cdc7230e21f24f03b46767323737c3d3f6fd0178fa8b7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f646f746b65726e656c2f646f742d6465627567626172)](https://github.com/dotkernel/dot-debugbar/issues)[![GitHub forks](https://camo.githubusercontent.com/6e0fe2046cedd431b0c0cf7960a77f0321cc3bc4ab45cf204ab063bb651836f7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f646f746b65726e656c2f646f742d6465627567626172)](https://github.com/dotkernel/dot-debugbar/network)[![GitHub stars](https://camo.githubusercontent.com/720788da50924271c9fef75eaa6858fbfaa538927ed4b9bc45bc910974ba6220/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f646f746b65726e656c2f646f742d6465627567626172)](https://github.com/dotkernel/dot-debugbar/stargazers)[![GitHub license](https://camo.githubusercontent.com/e3fcff1c28e3f7acc5e699b20369ca7922ff238107733c6ea9539bdddc9059bc/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f646f746b65726e656c2f646f742d6465627567626172)](https://github.com/dotkernel/dot-debugbar/blob/1.0/LICENSE.md)

[![Build Static](https://github.com/dotkernel/dot-debugbar/actions/workflows/continuous-integration.yml/badge.svg?branch=1.0)](https://github.com/dotkernel/dot-debugbar/actions/workflows/continuous-integration.yml)[![codecov](https://camo.githubusercontent.com/0d804792ce327eccfbacc06cbf989c41540002f20c12b23930051d08f8d2f7c3/68747470733a2f2f636f6465636f762e696f2f67682f646f746b65726e656c2f646f742d64656275676261722f67726170682f62616467652e7376673f746f6b656e3d46304e3856574b544457)](https://codecov.io/gh/dotkernel/dot-debugbar)[![docs-build](https://github.com/dotkernel/dot-debugbar/actions/workflows/docs-build.yml/badge.svg)](https://github.com/dotkernel/dot-debugbar/actions/workflows/docs-build.yml)[![PHPStan](https://github.com/dotkernel/dot-debugbar/actions/workflows/static-analysis.yml/badge.svg?branch=1.0)](https://github.com/dotkernel/dot-debugbar/actions/workflows/static-analysis.yml)

Install
-------

[](#install)

Install dot-debugbar in your application by running the following command:

```
composer require dotkernel/dot-debugbar
```

Setup
-----

[](#setup)

Once installed, the following components need to be registered by adding:

```
$app->pipe(\Dot\DebugBar\Middleware\DebugBarMiddleware::class);
```

to `config/pipeline.php` (preferably after `ServerUrlMiddleware::class`)

```
\Dot\DebugBar\ConfigProvider::class
```

to `config/config.php` (preferably at the beginning of the section where the `Dotkernel packages` are loaded)

```
\Dot\DebugBar\Extension\DebugBarExtension::class
```

to `config/autoload/templates.global.php` (inside the array founder under the key `twig` =&gt; `extensions`)

Locate the library's assets directory, called `assets` and copy **its contents** to your application under `public/debugbar` directory.

Locate the library's config file `config/debugbar.local.php` and clone it inside your application as:

- `config/autoload/debugbar.local.php.dist`
- `config/autoload/debugbar.local.php`

By default, dot-debugbar is enabled only on the local environment, by whitelisting your local IP address in the config file, inside the array located under the `ipv4Whitelist` key. If you need to enable it on other environments as well, just whitelist your public IPV4 address. It can also be enabled globally, by whitelisting the string `*`. Finally, if you want to keep the whitelists but disable dot-debugbar, you can set `enabled` to **false**.

Inside the config file, you will find additional configurations under the `javascript_renderer` key. For more configuration values, follow the link in the related comment block.

At this step, dot-debugbar is not displayed yet. In order to display it, you need to call the following Twig functions from your base layout:

```
{{ debugBarCss()|raw }}
```

(needs to be placed in the head section of the layout, where the CSS files are included)

```
{{ debugBarJs()|raw }}
```

(needs to be placed in the footer of the layout, where the JS files are included)

If you plan to enable dot-debugbar on production, make sure you clear the relevant cache items by deleting:

- the config cache file: `data/cache/config-cache.php`
- Twig cache directory: `data/cache/twig`

Additionally, you can check if dot-debugbar is enabled for your session by calling `debugBarEnabled()` inside a template. This feature can be useful if you need to add custom logic for when dot-debugbar is enabled.

Usage
-----

[](#usage)

Other than the data being automatically collected during a session, dot-debugbar can also be used to log messages, measure durations, debug database queries and more...

When you need an instance of DebugBar, locate an instance of it in your application's container using:

```
$debugBar = $container->get(\Dot\DebugBar\DebugBar::class);
```

then your factory can inject `$debugBar` as a dependency in your class.

OR

If you are using [dot-annotated-services](https://github.com/dotkernel/dot-annotated-services) inject it directly in your class's constructor.

Once an instance of DebugBar has been injected in your code, you can access all its features. The below examples will assume you already have an instance of DebugBar in your code, and it's callable using `$this->debugBar`.

### Logging messages

[](#logging-messages)

Results will show up in the debug bar under the `Messages` tab.

Log messages (can be of any type):

```
$this->debugBar->addMessage(1);
$this->debugBar->addMessage(true);
$this->debugBar->addMessage('foo');
$this->debugBar->addMessage(['foo']);
$this->debugBar->addMessage(new \stdClass());
```

Log messages and set custom label by specifying the 2nd argument (you can use any label, but `error` and `warning` use custom highlight and icons):

```
$exception = new \Exception('something went wrong');
$this->debugBar->addMessage($exception, 'error');
$this->debugBar->addMessage($exception->getMessage(), 'error');
$this->debugBar->addMessage('some warning', 'warning');
$this->debugBar->addMessage('custom message', 'custom');
```

Also, clicking on a label (found on the bottom right of the debugbar) will toggle the visibility of all messages with that specific label.

### Measure durations

[](#measure-durations)

Results will show up in the debug bar under the `Timeline` tab.

In order to measure how long does it take for a piece of code to execute, do the following:

```
$this->debugBar->measure('long operation', function () {
    // your code here
});
```

OR

```
$this->debugBar->startTimer('long operation', 'measuring long operation');
// your code here
$this->debugBar->stopTimer('long operation');
```

### Debug Doctrine queries

[](#debug-doctrine-queries)

Results will show up in the debug bar under the `Database` tab.

By default, all queries executed in order to load a page will be logged and displayed under this tab. If you submit a form that will perform a redirect, you won't see the executed CREATE/UPDATE queries unless you stack the collected data:

```
$this->debugBar->stackData();
```

The method needs to be called after all database operations have finished AND before emitting the redirect response. In this case, next to the `Memory usage` widget you'll see a dropdown that allows you to select between the previous page load (with the redirect) and the current one.

### Debug Exceptions

[](#debug-exceptions)

Results will show up in the debug bar under the `Exceptions` tab.

By registering `Dot\DebugBar\Middleware\DebugBarMiddleware`, dot-debugbar is ready to capture Exceptions.

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance25

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 69.6% 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 ~64 days

Recently: every ~78 days

Total

19

Last Release

432d ago

Major Versions

0.1.0 → 1.0.02022-01-11

PHP version history (4 changes)0.1.0PHP ^7.4

1.0.0PHP ~7.4.0||~8.0.0||~8.1.0

1.1.0PHP ~8.1.0 || ~8.2.0

1.1.5PHP ~8.1.0 || ~8.2.0 || ~8.3.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1156873?v=4)[Dotkernel](/maintainers/dotkernel)[@dotkernel](https://github.com/dotkernel)

---

Top Contributors

[![alexmerlin](https://avatars.githubusercontent.com/u/4542449?v=4)](https://github.com/alexmerlin "alexmerlin (39 commits)")[![Howriq](https://avatars.githubusercontent.com/u/63609103?v=4)](https://github.com/Howriq "Howriq (7 commits)")[![arhimede](https://avatars.githubusercontent.com/u/22009710?v=4)](https://github.com/arhimede "arhimede (6 commits)")[![bidi47](https://avatars.githubusercontent.com/u/27284979?v=4)](https://github.com/bidi47 "bidi47 (4 commits)")

---

Tags

debugdebugbarPHPdebugbar

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[snowair/phalcon-debugbar

Integrates PHP Debug Bar with Phalcon.

160123.3k1](/packages/snowair-phalcon-debugbar)

PHPackages © 2026

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