MyBB Community Forums

Full Version: A small plugin to help development - Global variable out
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This is a plugin I made for myself which I use a lot and I thought it might help some other people out to.

Thanks to Labrocca for the idea and I found the code for formatting the output here http://www.php.net/manual/en/function.print-r.php#91861

Basically it just gives you an easy to read output of the $mybb, $plugins, $templates or $db global variable. This is useful for debugging and so you know what data is available to you and what the variable name is. You can select which of these variables to output in your board settings.

To install just upload to the ./inc/plugins directory like any other plugin and activate.

Note: This is a plugin for development so only use this on your test board. When activated it will display the variable output instead of your forum.

Here is a print screen:
[attachment=17471]
File attached:
[attachment=17472]
Interesting idea, but personally, I just do a:
die(var_dump($annoying_variable));
in the code when I need to do debugging. With XDebug, the output of var_dump works quite well.
Looks very nice! I always used the var_dump or print_r functions, but this had a nice overview layout. Going to try it.