alsvanzelf / debugtoolbar
An improvement a day keeps the doctor away
Installs: 1 571
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 2
Open Issues: 0
pkg:composer/alsvanzelf/debugtoolbar
Requires
- php: >=8.1
- mustache/mustache: ^2.12
- paragonie/random_compat: ^2.0
- psr/log: ^2.0 || ^3.0
Requires (Dev)
- mongodb/mongodb: >=1.1
- monolog/monolog: >=1.0
- twig/twig: >=1.34
This package is auto-updated.
Last update: 2025-10-21 15:40:09 UTC
README
An improvement a day keeps the doctor away
Install
Via composer:
composer require --dev "alsvanzelf/debugtoolbar:dev-master"
Usage
- Copy
demo/dist/to a directory in your own application and serve it via the web. - Copy
demo/debug-display.phpto a directory in your own application and serve it via the web. - Setup a logger (i.e. Monolog) storing the results in a database.
- Adjust your application's page rendering in between rendering and sending it to the browser:
- to track data of the request:
$logId = Log::track($logger), - and add the toggler to the rendered body:
(new Toggler($logId))->render().
- to track data of the request:
- Optionally pass a
$scriptUrland$displayUrlto theToggler's constructor with the urls of thedistdirectory anddebug-display.phpcopied before. - Adjust the
debug-display.phpto fetch the data from the database used by the logger. - When using PDO: call
PDOPart::trackExecutedStatement($statement, $binds)after executing a PDO statement. - When using Twig: setup it's profiler and call
TwigPart::trackProfiler($profiler).