A small plugin to help development - Global variable out
#1
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:
   
File attached:

.zip   mybbout.zip (Size: 1.88 KB / Downloads: 125)
Reply
#2
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.
Reply
#3
Looks very nice! I always used the var_dump or print_r functions, but this had a nice overview layout. Going to try it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)