Quote:
Originally Posted by RoutineX
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.