There is a new maintained version of Kint! -> (kint-php)[https://github.com/kint-php/kint] thx@jnvsor
At first glance Kint is just a pretty replacement for var_dump(), print_r() and debug_backtrace().
Composer:
"require": {
"voku/kint": "^2.0"
}
Or just run composer require voku/kint
That's it, you can now use Kint to debug your code:
use kint\Kint;
Kint::enabled(true);
########## DUMP VARIABLE ###########################
Kint::dump($GLOBALS, $_SERVER); // pass any number of parameters
// or simply use d() as a shorthand:
\kint\d($_SERVER);
########## DEBUG BACKTRACE #########################
Kint::trace();
// or via shorthand:
\kint\d(1);
############# BASIC OUTPUT #########################
# this will show a basic javascript-free display
\kint\s($GLOBALS);
########## MISCELLANEOUS ###########################
# this will disable kint completely
Kint::enabled(false);
\kint\dd('Get off my lawn!'); // no effect
Kint::enabled(true);
\kint\dd( 'this line will stop the execution flow because Kint was just re-enabled above!' );
- Kint is disabled by default, call
kint\Kint::enabled(true);
to turn its funcionality on. The best practice is to enable Kint in DEVELOPMENT environment only (or for exampleKint::enabled($_SERVER['REMOTE_ADDR'] === '<your IP>');
) - so even if you accidentally leave a dump in production, no one will know.
Rokas Šleinius (Raveren)
Licensed under the MIT License