Download the PHP package johnykvsky/jkdumper without Composer
On this page you can find all versions of the php package johnykvsky/jkdumper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download johnykvsky/jkdumper
More information about johnykvsky/jkdumper
Files in johnykvsky/jkdumper
Package jkdumper
Short Description JKDumper is one-man-army quick'n'dirty debugging-logging tool
License MIT
Homepage https://github.com/johnykvsky/JKDumper
Informations about the package jkdumper
JKDumper
JKDumper is one-man-army quick'n'dirty debugging-logging tool. Good for both:
- legacy applications, where you have spaghetti code
- new projects, where you need to inject logger through 4 services just to dump some variables fot one time.
JKDumper is one file with optional logging library. Yes, it use singleton instance(), yes, it has static methods - it's just a tool and it need to be dead-simple to use in whatever sh**ty code we have to work.
Install
Via Composer
Should work fine on PHP 5.6, but I didn't check that. Just change required PHP version in composer.json and maybe remove dev packages.
Features
- Dumping variables to screen, basic formatting for easy reading
- Detecting if run from CLI (for proper formatting)
- Optional: logging variables to file (iw. when we want to check some process, not single thing)
- Optional: simple benchmarking via microtime()
If logger is set, then benchmarking is logged. Library use var_dump for dumping data, if needed it disable Xdebug 'overload_var_dump' (only for single dump, it is restored).
Usage
TL/DR: Nice way to make it a bit easier is to create function, ie. right after autoload:
This will allow us to dump variable to screen like this, with optional stopping further execution (second parameter):
Full example:
Log file example:
It's good to look at log library to see how it works and how it can be customized: jklogger
This is my choice of logger, but it can be replaced with anything compatibile with PSR-3 LoggerInterface
Testing
Code checking
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- johnykvsky
- [katzgrau][link-klogger]
License
The MIT License (MIT). Please see License File for more information.