maximebf / debugbar
Debug bar in the browser for php application
Installs: 91 752 027
Dependents: 192
Suggesters: 8
Security: 2
Stars: 4 197
Watchers: 76
Forks: 401
Open Issues: 126
Requires
- php: ^7.2|^8
- psr/log: ^1|^2|^3
- symfony/var-dumper: ^4|^5|^6|^7
Requires (Dev)
- dbrekelmans/bdi: ^1
- phpunit/phpunit: ^8|^9
- symfony/panther: ^1|^2.1
- twig/twig: ^1.38|^2.7|^3.0
Suggests
- kriswallsmith/assetic: The best way to manage assets
- monolog/monolog: Log using Monolog
- predis/predis: Redis storage
- dev-master / 1.23.x-dev
- 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-remove-trace-arg-objects
- dev-feat-extended-tooltips
- dev-feat-check-copy-result
- dev-feat-hide-empty-collectors
- dev-feat-subtle-copy
- dev-feat-openhandler-actionable
- 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: 2024-11-05 20:19:03 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.
Features:
- Generic debug bar
- 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 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:
Checkout the demo for examples and phpdebugbar.com for a live example.
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 maximebf/debugbar --dev
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.