View Single Post
  #296  
Old 04-02-2007, 11:49 PM
Billspaintball's Avatar
Billspaintball Billspaintball is offline
 
Join Date: Sep 2003
Location: Bathurst, Au
Posts: 649
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by RoutineX View Post
Hi.

Just a couple of questions:

1) I debugged while running the script, and I can't really see that $session[sessionhash] and $session[sessionurl] is used.
You can delete that if you like and it should still work, however vB use that in their code for a reason so I did the same.
Quote:
2) I'm not 100% sure how this works when it comes to performance, but when I debugged and looked at the available variables from the global.php there were a huge amount of vars and arrays that isnt needed at all.

Wouldn't it be best to only create objects of the things we really need (i.eg create the db object and get the $vbulletin[userinfo] array). If you i.eg look at $vbulletin['forumcache'] alone, it has over 408 arrays (depending on number of forums you have created) with 25 values each. Other unnecessary things are $header, headinclude, footer, etc etc.

Wouldn't this cause a higher load if this is processed everytime a page is viewed?
Yes there is a bunch of unnecessary stuff in global but I prefer to use it for several reasons.
1 - Better compatibility with future releases of vB. If vB make some changes to how various things work, chances are scripts will still work if they access those functions via the global.php file.
2 - Allows anyone to easily add any new function thats included in the global file.
3 - There is too much stuff happening behind the scenes in vB, its easy to miss some minor thing that causes problems later (like your UTF-8 one)
4 - More secure. Your not potentially creating any security holes with your own code trying to do back end stuff.
5 - The code in global.php is well tested and optimised.

As for extra server load by using global.php, just consider that vB uses it on every page anyhow so it shouldant make much of a difference on server load.
Quote:
3) After doing this, my second DB object won't retrieve info in UTF-8 anymore, even though I have:

mysql_query( "SET NAMES 'utf8'", $myDBobj );

Any tips on how to solve this?

Thanks =)
Sorry, not sure.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01910 seconds
  • Memory Usage 1,769KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete