Debugbar is a free and open source application that integrates into any PHP project and collects and presents analytical data.
It has no dependencies, supports AJAX requests, and includes general-purpose data collectors and collectors for common development libraries.
I believe that the Laravel debugging tool students, all feel that this tool is very powerful and easy to use, greatly improving the productivity of programmers, in fact, laravel This tool is used by the open source php-debugbar
upgrade.
How do we use this native debugging tool in other platform frameworks php-debugbar
?
This debug is composer
managed using a package, let's go first to Github
see how to use:
Maximebf/php-debugbar
Usage
1. Download package
Composer require Maximebf/debugbar
2. Specific usage
<?php//Require The Composer autoloader, if not already loadedrequire ' vendor/autoload.php '; use debugbar\ Standarddebugbar; $debugbar = new Standarddebugbar (); $debugbarRenderer = $debugbar->getjavascriptrenderer (); $ debugbar["Messages"]->addmessage ("Hello world!");? >
3, static resources are not loaded problem processing
When using, if the static resources of the package is not loaded, you need to modify the source code, because the static resource path of the source code is not found in the local server, the root URL of the source code is the relative path under the server such as: http://localhost/vendor/maximebf/debugbar/src/DebugBar/Resourc
such a path, and our package is placed under the server under http://localhost/web/php-debugbar/vendor/maximebf/debugbar/src/DebugBar/Resourc
such directory, So you need to JavascriptRenderer.php
$baseUrl
modify this variable for the file:
File Location:
vendor/maximebf/debugbar/src/debugbar/javascriptrenderer.php
The original $baseurl = '/vendor/maximebf/debugbar/src/debugbar/resources ';//modified with only one point representing the current path "." $baseUrl = './vendor/maximebf/debugbar/src/debugbar/resources ';