maximebf / debugbar
Debug bar in the browser for php application
Installs: 108 254 620
Dependents: 175
Suggesters: 8
Security: 2
Stars: 4 281
Watchers: 73
Forks: 414
Open Issues: 130
pkg:composer/maximebf/debugbar
Requires
- php: ^8.2
- psr/log: ^1|^2|^3
- symfony/var-dumper: ^5.4|^6.4|^7.3|^8.0
Requires (Dev)
- dbrekelmans/bdi: ^1.4
- friendsofphp/php-cs-fixer: ^3.92
- monolog/monolog: ^3.9
- phpstan/phpstan: ^2.1
- phpstan/phpstan-phpunit: ^2.0
- phpunit/phpunit: ^10
- predis/predis: ^3.3
- symfony/browser-kit: ^6.4|7.0
- symfony/dom-crawler: ^6.4|^7
- symfony/event-dispatcher: ^5.4|^6.4|^7.3|^8.0
- symfony/mailer: ^5.4|^6.4|^7.3|^8.0
- symfony/panther: ^1|^2.1
- twig/twig: ^3.11.2
Replaces
- maximebf/debugbar: v3.0-beta.2
- 3.x-dev
- dev-master / 3.0.x-dev
- v3.0-beta.2
- v3.0-beta.1
- 2.x-dev
- v2.2.6
- v2.2.5
- v2.2.4
- v2.2.3
- v2.2.2
- v2.2.1
- v2.2.0
- v2.1.6
- v2.1.5
- v2.1.4
- v2.1.3
- v2.1.2
- v2.1.1
- v2.1.0
- v2.0.1
- v2.0.0
- v2.0.0-beta2
- v2.0.0-beta1
- 1.x-dev
- v1.23.6
- v1.23.5
- v1.23.4
- v1.23.3
- v1.23.2
- v1.23.1
- v1.23.0
- v1.22.6
- v1.22.5
- v1.22.4
- v1.22.3
- v1.22.2
- v1.22.1
- v1.22.0
- v1.21.3
- v1.21.2
- v1.21.1
- v1.21.0
- v1.20.2
- v1.20.1
- v1.20.0
- v1.19.1
- v1.19.0
- v1.18.2
- v1.18.1
- v1.18.0
- v1.17.3
- v1.17.2
- v1.17.1
- v1.17.0
- v1.16.5
- v1.16.4
- v1.16.3
- v1.16.2
- v1.16.1
- v1.16.0
- v1.15.1
- v1.15.0
- v1.14.1
- v1.14.0
- 1.13.1
- v1.13.0
- v1.12.0
- v1.11.1
- v1.11.0
- v1.10.5
- v1.10.4
- v1.10.3
- v1.10.2
- 1.10.1
- 1.10.0
- 1.9.15
- 1.9.14
- 1.9.13
- 1.9.12
- 1.9.11
- 1.9.10
- 1.9.9
- 1.9.8
- 1.9.7
- 1.9.6
- 1.9.5
- 1.9.4
- 1.9.3
- 1.9.2
- 1.9.1
- 1.9
- 1.8
- 1.7.1
- 1.7
- 1.6.1
- 1.6
- 1.5.1
- 1.5
- 1.4
- 1.3
- 1.2
- 1.1
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0
- dev-feat-top-bar
- dev-tweak-backtrace-lmit
- dev-fix-vardumper
- dev-fix-lint
- dev-fix-autoshow
- dev-v3-beta
- dev-remove-docs
- dev-feat-openhandler-actionable
- dev-copilot/sub-pr-670
- dev-3.x-dump-dist-assets
- dev-3.x-phpstan-level6
- dev-3.x-phpstan-level5
- dev-3.x-actions
- dev-3x-no-serialize
- dev-3.x-demo
- dev-3.x-strict-types
- dev-3.x-per-cs
- dev-3.x-analyse
- dev-3x-minify-tweak
- dev-3.x-tweak-minify
- dev-3.x-classes
- dev-3.x-nativejs
- dev-3.x-templates
- dev-3.x-message-icons
- dev-3.x-deprecated
- dev-3.x-assets
- dev-3.x-sprites
- dev-feat-widget-icons
- dev-tweak-icons
- dev-3.x-fetch
- dev-feat-build-vendor
- dev-feat-eslint
- dev-feat-es6
- dev-deprecate-doctrine-bridge
- dev-test-wait-for-visibility
- dev-panther-nodevtools
- dev-dark-dumper
- dev-barryvdh-patch-4
- dev-feat-tab-text-size
- dev-feat-ulid
- dev-barryvdh-patch-3
- dev-sort-widgets
- dev-fix-badges
- dev-fix-empty-time
- dev-feat-group-timeline
- dev-feat-link-timeline
- dev-fix-openhandler-theme
- dev-barryvdh-patch-2
- dev-feat-link-indicator
- dev-feat-fix-links
- dev-Rename-to-php-debugbar
- dev-feat-rename-bump-package
- dev-dev-keyword
- dev-feat-fix-lineheight
- dev-feat-hljs
- dev-revert-dragging
- dev-feat-offset-20
- dev-barryvdh-patch-1
- dev-feat-dragicon
- dev-remove-trace-arg-objects
- dev-feat-extended-tooltips
- dev-feat-check-copy-result
- dev-feat-hide-empty-collectors
- dev-feat-subtle-copy
- dev-escape-doctrine
- dev-feat/fa-icons
- dev-feat-dataset-combine
- dev-test-integration
- dev-feat-dataset-tab
- dev-feat-fetch-only
- dev-fix-mail-html
- dev-fix-body-check
- dev-feat-mailbody
- dev-revert-606-patch-32
- dev-feat-xdebuglink-varlist
- dev-feat-jquery4-deprecations
- dev-fix/interpolate
- dev-fix/vardumper
- dev-feat-servertiming
- dev-fix-unsafe-headers
- dev-reset
- dev-feat-dynamic-padding
- dev-dev_rebased
- dev-util
- dev-timedate-memory
- dev-dev
- dev-serverhandler
This package is auto-updated.
Last update: 2025-12-28 19:01:05 UTC
README
Displays a debug bar in the browser with information from php.
No more var_dump() in your code!
Note: Debug Bar is for development use only. Never install this on websites that are publicly accessible.
V3 Beta
Currently v3 is in beta. You can install it with composer require php-debugbar/php-debugbar:^3.0@beta.
See the Upgrade guide for more information and breaking changes.
Features:
- Generic Debug Bar for PHP projects
- Easy to integrate with any project
- Clean, fast and easy to use interface
- Handles AJAX request
- Includes generic data collectors and collectors for well known libraries
- The client side bar is 100% coded in plain javascript
- Easily create your own collectors and their associated view in the bar
- Save and re-open previous requests
- Very well documented
Includes collectors for:
- Messages
- Config
- Time
- Memory
- Exceptions
- PHP Info
- Request Data
- Templates
- Object Count
- PDO
- Monolog
- Symfony Mailer
Checkout the demo for examples and phpdebugbar.com for a live example.
Additional collectors are available here:
Integrations with other frameworks:
- Laravel
- Atomik
- XOOPS
- Zend Framework 2
- Phalcon
- SilverStripe
- Grav CMS
- TYPO3
- Joomla
- Drupal
- October CMS
- Framework-agnostic middleware and PSR-7 with php-middleware/phpdebugbar
- Dotkernel Frontend Application
(drop me a message or submit a PR to add your DebugBar related project here)
Installation
The best way to install DebugBar is using Composer with the following command:
composer require --dev php-debugbar/php-debugbar
Quick start
DebugBar is very easy to use and you can add it to any of your projects in no time.
The easiest way is using the render() functions
<?php // Require the Composer autoloader, if not already loaded require 'vendor/autoload.php'; use DebugBar\StandardDebugBar; $debugbar = new StandardDebugBar(); $debugbarRenderer = $debugbar->getJavascriptRenderer(); $debugbar["messages"]->addMessage("hello world!"); ?> <html> <head> <?php echo $debugbarRenderer->renderHead() ?> </head> <body> ... <?php echo $debugbarRenderer->render() ?> </body> </html>
The DebugBar uses DataCollectors to collect data from your PHP code. Some of them are
automated but others are manual. Use the DebugBar like an array where keys are the
collector names. In our previous example, we add a message to the MessagesCollector:
$debugbar["messages"]->addMessage("hello world!");
StandardDebugBar activates the following collectors:
MemoryCollector(memory)MessagesCollector(messages)PhpInfoCollector(php)RequestDataCollector(request)TimeDataCollector(time)ExceptionsCollector(exceptions)
Learn more about DebugBar in the docs.
Demo
To run the demo, clone this repository and start the Built-In PHP webserver from the root:
php -S localhost:8000
Then visit http://localhost:8000/demo/
Testing
To test, run php vendor/bin/phpunit.
To debug Browser tests, you can run PANTHER_NO_HEADLESS=1 vendor/bin/phpunit --debug. Run vendor/bin/bdi detect drivers to download the latest drivers.
Contributing
When contributing to the JavaScript codebase:
- Run
npm run lintandnpm run buildbefore committing - Fix any errors (warnings are acceptable but should be minimized)
- Use
npm run lint:fixfor automatic fixes where possible - Follow the ES6+ patterns established in the codebase
When contributing to the PHP codebase:
- Run
composer check-styleandcomposer analysebefore committing. - Make sure the tests pass (see above)
- Verify that the demo works correctly (
php -S localhost:8000 demo/)