MyBB Community Forums
[For 1.6] MyDevel: Debug - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Extensions (https://community.mybb.com/forum-201.html)
+--- Forum: Plugins (https://community.mybb.com/forum-73.html)
+---- Forum: Plugin Releases (https://community.mybb.com/forum-102.html)
+---- Thread: [For 1.6] MyDevel: Debug (/thread-85783.html)

Pages: 1 2


MyDevel: Debug - Aries-Belgium - 2011-01-07

This plugin is for development purposes only and is the second plugin in the MyDevel series, a series of plugins for MyBB plugin developers and themers.
Other plugins:
- MyDevel: Generate: Generate random content and users.

As every plugin developer knows, during the development stage of a plugin you need to use var_dump() or print_r() a lot. This is the normal way of debugging in PHP but this breaks the layout and style of MyBB and puts the information on top of the page without any markup or structure. MyDevel: Debug adds two simple functions to MyBB to add debug information in the header and structures it in a more convenient way. Arrays and objects are structured in a tree-like way and levels are (de)collapsible.

       

The functions that can be used are:
1) mydump()
This is a variant of var_dump(). The first parameter is the variable you would like to see. The second optional parameter is the name to easily identify the dump.
mydump($var, $name='...');
2) mybacktrace()
This will dump the backtrace to the debug section. It doesn't take any parameter.
mybacktrace();

The plugin also includes a test package which you can activate if you like to see the functionality of this plugin. After you activated this test package, post a new thread to your forum and you will see the content of the $mybb and $thread_info variable in the header. In the AdminCP Dashboard you will also see a dump that was made from a admincp hook.

There are two settings that can be set:
- The usergroups separated by a comma for which the debug information should be visible. By default this is only usergroup 4 (= Administrators)
- The skin of the debug information.

Download: http://mods.mybb.com/view/mydevel-debug


RE: MyDevel: Debug - Polarbear541 - 2011-01-08

Approved Smile
Please also insert the mods site link.


RE: MyDevel: Debug - Aries-Belgium - 2011-01-08

(2011-01-08, 06:47 PM)Kieran D. Wrote: Approved Smile
Please also insert the mods site link.

Thanks and done Wink


RE: MyDevel: Debug - danysalva - 2011-01-08

Thankyou, could be so good for developers.


RE: MyDevel: Debug - lorus - 2011-01-18

Thank you for this wonderful plugin. I think this will safe me a lot of time Smile


RE: MyDevel: Debug - Aries-Belgium - 2011-01-18

(2011-01-18, 05:19 PM)lorus Wrote: Thank you for this wonderful plugin. I think this will safe me a lot of time Smile

You're welcome Wink


RE: MyDevel: Debug - lorus - 2011-01-26

Can you please make mydump() also work inside the ACP? Smile


RE: MyDevel: Debug - Aries-Belgium - 2011-01-26

(2011-01-26, 11:52 AM)lorus Wrote: Can you please make mydump() also work inside the ACP? Smile

Yes, that will be available in the next release Smile Thanks for your feedback Smile


RE: MyDevel: Debug - lorus - 2011-01-27

Just another suggestion: It would be nice, if the name of the variable, which is dumped with mydump(), is shown in the head of the krumo-box.


RE: MyDevel: Debug - Aries-Belgium - 2011-01-31

Just uploaded version 1.1 to the mod site. While the plugin is waiting activation, you can download the attachment on the first post.

In version 1.1 the functions are also available in AdminCP pages and you are able to pass a name to a dump to easily identify a dump.

(2011-01-27, 10:19 AM)lorus Wrote: Just another suggestion: It would be nice, if the name of the variable, which is dumped with mydump(), is shown in the head of the krumo-box.
This is afiak not possible. Even in debug_backtrace() only the value a var that is passed to a function is shown. But I added the option to give a dump a name, like this:
mydump($mybb, "mybb object");
This will then show up in the debug box instead of the tree dots. I hope this will help identifying the dump.