Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Debug Functions - trace and traceQuery Details »
Debug Functions - trace and traceQuery
Mod Version: 1.00, by Michael Morris (Member) Michael Morris is offline
Developer Last Online: Jun 2009 I like it Show Printable Version Email this Page

This modification is in the archives.
vB Version: 3.7.2 Rating: (0 vote - 0 average) Installs: 10
Released: 14 Jul 2008 Last Update: 14 Jul 2008 Downloads: 38
Not Supported Additional Files Re-usable Code Translations  

Minimum PHP version: 5.0.0

This mod is simply a php file that contains a couple of functions I created while developing the PAM webframework. While tiny they are highly useful.

If you are not a developer, do not install this modification - it does absolutely nothing useful on a live board. What is worse it turns on debug mode just in case you forgot the config command to do so and you don't want debug mode to be on with a live board.

There are two functions in the PHP file. You can call them in your plugins at any point after the config.php file has been read.

Installation

Upload the file to your includes folder and add the following line to your config.php file.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

That's it. Until you actually call one of the two functions it does nothing but turn on debug mode.

Using the functions

There are two functions in this package at present and this is what they do...

void trace ( mixed, ...)

Use trace where you would use echo or print_r -- it's smart enough to determine which it needs to be. The function can be overloaded - so if you need to check the status of multiple variables just pile them in. The function sends headers if it can and sets the response type to text/plain - this makes the print_r results well formatted and easy to read. The function then calls debug_backtrace to show you what's on the stack at the point it fired and this incidentally let's you know what file and what line it exists on, so you can't accidentally forget to remove it.

void traceQuery( string )

The traceQuery function takes an sql statement at its argument. It runs the query, then halts execution and prints the time that query took to resolve along with the first row's result set and how many total rows where "raised" by the query. This function exists mainly for big board optimization.

While I'm putting this in the 3.7.2 area this mod works with all versions of vbulltin 3.6 and later.

Download Now

Only licensed members can download files, Click Here for more information.

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • If you like this modification support the author by donating.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Comments
  #2  
Old 05 Aug 2009, 17:44
newmasalaboard's Avatar
newmasalaboard newmasalaboard is offline
 
Join Date: Apr 2008
Real name: Satyadeo Thakur
Thanks !!

Installed ...
Reply With Quote
  #3  
Old 05 Aug 2009, 22:08
sockwater's Avatar
sockwater sockwater is offline
 
Join Date: Apr 2008
Thanks Michael, handy little functions. I dropped 'em into init_startup on a test installation for now.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 13:41.

Layout Options | Width: Wide Color: