Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.7 > vBulletin 3.7 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Debug Functions - trace and traceQuery Details »»
Debug Functions - trace and traceQuery
Version: 1.00, by Michael Morris Michael Morris is offline
Developer Last Online: Jun 2009 Show Printable Version Email this Page

Category: Administrative and Maintenance Tools - Version: 3.7.2 Rating:
Released: 07-13-2008 Last Update: 07-13-2008 Installs: 12
Re-useable Code Additional Files Translations  
No support by the author.

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.

PHP Code:
include_once('includes/vbDebug.php'); 
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.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 08-05-2009, 04:44 PM
newmasalaboard's Avatar
newmasalaboard newmasalaboard is offline
 
Join Date: Apr 2008
Location: Raipur [C.G.], INDIA
Posts: 63
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks !!

Installed ...
Reply With Quote
  #3  
Old 08-05-2009, 09:08 PM
sockwater's Avatar
sockwater sockwater is offline
 
Join Date: Apr 2008
Posts: 187
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Michael, handy little functions. I dropped 'em into init_startup on a test installation for now.
Reply With Quote
Reply


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

Forum Jump


All times are GMT. The time now is 05:53 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03451 seconds
  • Memory Usage 2,221KB
  • Queries Executed 18 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (3)post_thanks_box
  • (3)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit_info
  • (2)postbit
  • (3)postbit_onlinestatus
  • (3)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete