Describes how to use the open-source DebugBar tool to Debug PHP code.

Source: Internet
Author: User
DebugBar is a free and open-source application that can be integrated into any PHP project and collect and display analysis data. It has no dependencies and supports Ajax requests, including common data collectors and collectors of common development libraries. I believe that anyone who has used Laravel's debugging tool will feel this...

DebugBar is a free and open-source application that can be integrated into any PHP project and collect and display analysis data.
It has no dependencies and supports Ajax requests, including common data collectors and collectors of common development libraries.

I believe that those who have used Laravel's debugging tool feel that this tool is very powerful and easy to use, greatly improving the programmer's production efficiency. In fact, Laravel is an open-source tool.php-debugbarUpgraded.

Maximebf/php-debugbar

Usage 1. download the package
composer require maximebf/debugbar
2. usage
 getJavascriptRenderer();$debugbar["messages"]->addMessage("hello world!");?>            
 renderHead() ?>                ...        
 render() ?>    
3. handling of static resources not loaded

If the static resources of the package are not loaded during use, you need to modify the source code because the static resource path of the source code cannot be found on the local server, the source code root URL uses the relative path under the server, for example:http://localhost/vendor/maximebf/debugbar/src/DebugBar/ResourcThis path, while our package is placed under the serverhttp://localhost/web/php-debugbar/vendor/maximebf/debugbar/src/DebugBar/ResourcIn this directory, you needJavascriptRenderer.phpFile$baseUrlModify this variable:

File location:

vendor/maximebf/debugbar/src/DebugBar/JavascriptRenderer.php
// The original $ baseUrl = '/vendor/maximebf/debugbar/src/DebugBar/resources'; // after modification, only one vertex indicating the current path is added ". "$ baseUrl = '. /vendor/maximebf/debugbar/src/DebugBar/Resources ';

The above section details how to use the open-source DebugBar tool to Debug PHP code (text). For more information, see other related articles in the first PHP community!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.