PHPackages                             zappzarapp/devtoolbar - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. zappzarapp/devtoolbar

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

zappzarapp/devtoolbar
=====================

In-app developer toolbar for PHP applications: timeline, query analyzer, HTTP/cache collectors, exception tracking, request history. Ships the JS UI as a bundled asset (symfony/web-profiler-bundle pattern).

v1.0.0(today)025↑2900%MITPHPPHP ^8.4CI failing

Since Jul 23Pushed todayCompare

[ Source](https://github.com/marcstraube/zappzarapp-php-devtoolbar)[ Packagist](https://packagist.org/packages/zappzarapp/devtoolbar)[ Docs](https://github.com/marcstraube/zappzarapp-php-devtoolbar)[ RSS](/packages/zappzarapp-devtoolbar/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (15)Versions (2)Used By (0)

⚡ zappzarapp/devtoolbar
=======================

[](#-zappzarappdevtoolbar)

In-app developer toolbar for PHP applications. Renders a mini-bar overlay with collectors for queries, HTTP requests, cache operations, exceptions, timeline phases, and request history, with N+1 detection and configurable performance alerts.

The JavaScript UI ships as a pre-built asset of this PHP package (the [symfony/web-profiler-bundle](https://github.com/symfony/web-profiler-bundle)pattern): `composer require` is all a consumer needs — no Node toolchain, no `npm install`.

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

[](#requirements)

- PHP **8.4+**
- `monolog/monolog` ^3.0 — `MessageCollector` extends `AbstractProcessingHandler`
- `zappzarapp/security` ^1.0 — supplies the per-request CSP nonce for the injected `` / `` tags

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

[](#installation)

```
composer require --dev zappzarapp/devtoolbar
```

Install it as a **dev dependency**. The toolbar is a development-time surface and its activation guard is fail-closed (see [Activation](#activation)).

Usage
-----

[](#usage)

Boot the toolbar at the top of your front controller and register an output buffer callback that injects the toolbar HTML before ``:

```
use Zappzarapp\DevToolbar\DevToolbar;
use Zappzarapp\DevToolbar\Guard\DevToolbarGuard;

require __DIR__ . '/../vendor/autoload.php';

if (DevToolbarGuard::isEnabled()) {
    $toolbar = DevToolbar::getInstance();
    $toolbar->boot();

    // injectToolbar() runs when the buffer is flushed — a safe alternative
    // to echoing from a shutdown function.
    ob_start([$toolbar, 'injectToolbar']);
}

// ... dispatch the request and render the response as usual ...
```

`boot()` and `injectToolbar()` are both no-ops when the guard reports the toolbar as disabled, so the two calls above are safe to leave in place; guard them with `isEnabled()` only to avoid the output-buffer overhead in production.

### Activation

[](#activation)

`DevToolbarGuard::isEnabled()` is **fail-closed** — the toolbar stays off unless a development environment is proven. The decision, in order:

1. **`ENABLE_DEV_TOOLBAR`** — an explicit on/off switch. `true` (any case) or `1` enables; anything else, including typos, disables.
2. Otherwise the first set of **`APP_ENV`** then **`ENV`** must equal one of `dev`, `development`, `local`, `test`, `testing` (case-insensitive).
3. A missing or unrecognized environment is treated as production → disabled.

The guard also disables under the CLI SAPI and for AJAX requests. Values are read via `getenv()` with an `$_ENV` / `$_SERVER` fallback, so PHP-FPM setups running with `clear_env=yes` do not silently fail open.

### CSP nonce

[](#csp-nonce)

Injected inline `` / `` tags carry the per-request nonce from `zappzarapp/security`'s `NonceRegistry` — there is no `unsafe-inline`requirement. If your application generates its own nonce, hand it to the toolbar **before** `boot()`:

```
$toolbar->setNonce($cspNonce);
```

### Feeding collectors

[](#feeding-collectors)

`boot()` registers the default collectors and starts them. Instrument your application by fetching a collector and recording operations as they happen:

```
$queries = $toolbar->getCollector('queries');
$queries?->trackQuery($sql, $bindings, $durationMs);
```

Available collector names: `request`, `queries`, `http`, `cache`, `messages`, `exceptions`, `timeline`, `history`. See the classes under `Zappzarapp\DevToolbar\DataCollectors` for each collector's tracking API.

Security
--------

[](#security)

The toolbar exposes request internals (SQL, request/response data, exception backtraces) to anyone who can render it. Never enable it in production, and treat any environment reachable beyond localhost as production. See [SECURITY.md](SECURITY.md) for the full model.

License
-------

[](#license)

MIT — see [LICENSE](LICENSE).

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance100

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

0d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2251d276d4ad2322f19fb6b755a30a7280450b26534a8b1137cf8c2680daf8da?d=identicon)[marcstraube](/maintainers/marcstraube)

---

Top Contributors

[![marcstraube](https://avatars.githubusercontent.com/u/52066916?v=4)](https://github.com/marcstraube "marcstraube (2 commits)")

---

Tags

debug-toolbardebuggingdeveloper-toolsphpphp84profilingpsr-3profilerdebug barperformancetimelinemonologphp8n-plus-onedeveloper toolbar

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Psalm, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/zappzarapp-devtoolbar/health.svg)

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

###  Alternatives

[inpsyde/wonolog

Monolog-based logging package for WordPress.

184637.3k7](/packages/inpsyde-wonolog)[bitrix-expert/monolog-adapter

Monolog adapter for Bitrix CMS

6566.7k](/packages/bitrix-expert-monolog-adapter)[naoray/laravel-github-monolog

Log driver to store logs as github issues

10923.3k](/packages/naoray-laravel-github-monolog)[alexandre-daubois/monolog-processor-collection

A collection of Monolog processors

1317.1k](/packages/alexandre-daubois-monolog-processor-collection)[filips123/monolog-phpmailer

PHPMailer handler for Monolog

1371.8k3](/packages/filips123-monolog-phpmailer)[mhcg/monolog-wp-cli

Extension for Monolog to support outputting to WP-CLI (The WordPress command line interface) when running wp command lines.

10112.6k1](/packages/mhcg-monolog-wp-cli)

PHPackages © 2026

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