GitHub - maximebf/php-debugbar: Debug bar for PHP
source link: https://github.com/maximebf/php-debugbar
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
README.md
PHP Debug Bar
Displays a debug bar in the browser with information from php.
No more var_dump()
in your code!
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
- Framework-agnostic middleware and PSR-7 with php-middleware/phpdebugbar.
(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
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.
Recommend
-
142
Laravel Debugbar This is a package to integrate PHP Debug Bar with Laravel. It includes a ServiceProvider to register the debugbar and attach it to the output. You can publish assets a...
-
71
README.md
-
14
AWS SAM The AWS Serverless Application Model (SAM) is an open-source framework for building serverless applications. It provides shorthand syntax to express functions, APIs, databases, and event source mappings. With just a few lines...
-
11
Copy link Contributor derekdreery ...
-
11
Copy link Contributor guswynn commented
-
10
New issue Remove T: Debug bound on UnsafeCell Debug impl #83707
-
7
flutter_ume English Flutter 应用内调试工具平台 当前版本内置 10 个插件, 开发者可以创建自己的插件,并集成进 UME 平台。 详见本文
-
7
README BARCHART ======== This program makes bar charts. For example...
-
7
Introduction It's important to keep a few things in mind while developing web apps. When it comes to building large and powerful applications, a competent developer will always follow best practices. Testing, debugging...
-
7
Progress Bar for Terraform Add an interactive progress bar to terraform commands.
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK