Simple and powerful PHP debugging tool Kint

Recommended for you: Get network issues from WhatsUp Gold. Not end users.
A good use of the PHP DEBUG tool ---Kint http://raveren.github.io/kint/ You can almost get all the information about it on the home page, I am here only for this tool and make a brief introduction.
It is a no installation, easy to use, powerful PHP debugging assistant, it can be a very good alternative to var_dump (), print_r (), debug_backtrace () function.


It is designed in the test data can be the best way to show you. A direct look at the pictures, you can see the variables




Characteristic

The installation and the use are very simple (below will be explained); can identify the output, and it is easy to understand way to show:

See you type and value content, as well as its output; source: one line, which is the function call.;

Instead of debug_backtrace () to view the stack debugging tracing information: customizable theme:


Install and use

Demand:

PHP 5+ (additional feature requires 5.3+), modern browsers.

Installation:

The Kint directory on your ideas are placed randomly, then only need to include the Kint.class.php start´╝ü

Fast start:

<?php
require '/kint/Kint.class.php';


Kint::dump( $_SERVER );
// Perhaps, you can try more simple, use abbreviations:
d( $_SERVER );
// Or, you can use DD () directly after procedures at the end of print;
dd( $_SERVER ); // Equivalent to D( $_SERVER ); die;


// Debug information:
Kint::trace();
// So write to the same with the above effect
Kint::dump( 1 );


// Disable all output
Kint::enabled(false);
// After this method is called, will not be output.
d('Get off my lawn!'); // No effect

To configure

You can rename the default configuration of config.default.php into config.php, so that your own configuration will override the default configuration. In the configuration file, each of which has a detailed description of.


Advanced usage

Text output

Can only output the text information, not like before that type style;
<?php
s( $variable );
// Also
sd( $variable ); // The output end of direct exit, remember the above DD (right)

Real time modifier

<?php
+Kint::dump( $variable );
// Or so to write
+d( $variable );

The available modifiers have:
+Kint::dump(); Will ignore the nesting level limit - when you export a particularly responsible for the object (for example an array nested levels deep time), you will receive a *DEPTH TOO GREAT* information, use the modifier can ignore this restriction,
Warning: may cause the browser anomaly

-Kint::dump(); Will clear before this all output information at the top of the page display;
When the variable in HTML, use this would be particularly useful, and DD () are used together is also very effective;
In the ob_clear () and ob_start () use may fail in the environment;

@Kint::dump(); Returns Kint: (value: dump);, instead of printing results, you can refer to the print_r (, true); - can be used to log;
!Kint::dump();Output will be automatically unfolded, you don't have to manually to the point.
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Vernon at January 25, 2014 - 10:26 AM