Leeoniya
06-21-2011, 10:38 PM
hello fellow PHPers,
finally i got around to making something which i feel is a much improved, lightweight and tweakable combo of print_r() and var_dump(). i bet 90% use-cases for these functions dump into a browser, not a text editor, so why not use everything HTML/js has to offer?
there are plenty of other alternatives (dBug (http://dbug.ospinto.com/), debuglib (http://phpdebuglib.de/debuglib.php), wtUtil (http://redotheoffice.com/?p=65), krumo (http://krumo.sourceforge.net/), kint (http://code.google.com/p/kint/), php dump (http://jacksleight.com/old/assets/blog/really-shiny/scripts/php-dump.txt), Debug::dump (http://codeaid.net/php/improved-var_dump%28%29-with-colored-output)), but none that lived up to my minimalist, lightweight, configurable and non-verbose desires. dump_r is completely CSS-styled, plus there are additional classes added that can usefully categorize items such as "type" "subtype" "empty" "numeric"
currently, the functionality is more-than-adequate, but is always a work in progress. i have my TODO list in the Issues section. feel free to fork, make pull requests or report any bugs or enhancements.
for folding/unfolding, the example page links jQuery 1.6.1 and uses a small dump_r.js file to initialize the click handlers. it would be pretty easy to kill the jQuery dependency with some good ole' fashion plain DOM js, but i didn't feel like it since most of my projects already have it loaded :)
https://github.com/leeoniya/dump_r.php
would love some feedback. happy dumping!
leon
finally i got around to making something which i feel is a much improved, lightweight and tweakable combo of print_r() and var_dump(). i bet 90% use-cases for these functions dump into a browser, not a text editor, so why not use everything HTML/js has to offer?
there are plenty of other alternatives (dBug (http://dbug.ospinto.com/), debuglib (http://phpdebuglib.de/debuglib.php), wtUtil (http://redotheoffice.com/?p=65), krumo (http://krumo.sourceforge.net/), kint (http://code.google.com/p/kint/), php dump (http://jacksleight.com/old/assets/blog/really-shiny/scripts/php-dump.txt), Debug::dump (http://codeaid.net/php/improved-var_dump%28%29-with-colored-output)), but none that lived up to my minimalist, lightweight, configurable and non-verbose desires. dump_r is completely CSS-styled, plus there are additional classes added that can usefully categorize items such as "type" "subtype" "empty" "numeric"
currently, the functionality is more-than-adequate, but is always a work in progress. i have my TODO list in the Issues section. feel free to fork, make pull requests or report any bugs or enhancements.
for folding/unfolding, the example page links jQuery 1.6.1 and uses a small dump_r.js file to initialize the click handlers. it would be pretty easy to kill the jQuery dependency with some good ole' fashion plain DOM js, but i didn't feel like it since most of my projects already have it loaded :)
https://github.com/leeoniya/dump_r.php
would love some feedback. happy dumping!
leon