https://github.com/lode/debug-toolbar
An improvement a day keeps the doctor away
https://github.com/lode/debug-toolbar
Last synced: 12 months ago
JSON representation
An improvement a day keeps the doctor away
- Host: GitHub
- URL: https://github.com/lode/debug-toolbar
- Owner: lode
- License: mit
- Created: 2017-07-28T15:43:10.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2024-03-21T12:34:34.000Z (over 2 years ago)
- Last Synced: 2025-04-04T00:33:30.323Z (about 1 year ago)
- Language: PHP
- Size: 1.12 MB
- Stars: 0
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# debug-toolbar
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.php` to a directory in your own application and serve it via the web.
- Setup a logger (i.e. [Monolog](https://github.com/Seldaek/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()`.
- Optionally pass a `$scriptUrl` and `$displayUrl` to the `Toggler`'s constructor with the urls of the `dist` directory and `debug-display.php` copied before.
- Adjust the `debug-display.php` to 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](https://twig.symfony.com/doc/2.x/api.html#profiler-extension) and call `TwigPart::trackProfiler($profiler)`.