Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 06-26-2005, 02:21 AM
futureal futureal is offline
 
Join Date: Feb 2002
Location: Del Mar, CA, USA
Posts: 556
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Why build_datastore with no arguments?

While tinkering around in vB3's code, I noticed many places that do something like (in pseudo-pseudocode):

$DB_site->query("UPDATE datastore SET ... ");
build_datastore();

Since the build_datastore function takes two arguments (title and data) and does nothing if the arguments aren't given...what's the point?

Were these calls added for stylistic reasons, or...? Perhaps future development?

I know this is an oddball question, just looking for an answer to satisfy my curiosity.
Reply With Quote
  #2  
Old 06-26-2005, 03:37 AM
Link14716's Avatar
Link14716 Link14716 is offline
 
Join Date: Jun 2002
Location: Georgia, USA
Posts: 2,519
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by futureal
While tinkering around in vB3's code, I noticed many places that do something like (in pseudo-pseudocode):

$DB_site->query("UPDATE datastore SET ... ");
build_datastore();

Since the build_datastore function takes two arguments (title and data) and does nothing if the arguments aren't given...what's the point?

Were these calls added for stylistic reasons, or...? Perhaps future development?

I know this is an oddball question, just looking for an answer to satisfy my curiosity.
That's an interesting question. It doesn't make a whole lot of sense, does it?
Reply With Quote
  #3  
Old 06-26-2005, 05:20 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

very good question.

maybe it was planned to update the datastore chache when running it without parameters, but they forgot it or decided otherwise..
Reply With Quote
  #4  
Old 06-26-2005, 06:52 PM
Revan's Avatar
Revan Revan is offline
 
Join Date: Jan 2004
Location: Norway
Posts: 1,671
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Um, have you all been smoking crack or something? build_datastore without arguments CLEARLY rebuilds the $vboptions/$vbulletin->options array.
I've been using that in my installers since I learned of the function, and the array has always been updated just like it should.
Reply With Quote
  #5  
Old 06-26-2005, 06:58 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

At least in 3.0.7 and 3.5.0 Beta 2 a call to build_datastore() without arguments does nothing.
Reply With Quote
  #6  
Old 06-26-2005, 07:11 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by KirbyDE
At least in 3.0.7 and 3.5.0 Beta 2 a call to build_datastore() without arguments does nothing.
It does nothing in any version of 3.0.x I have (3.0.1 +) the code is the same in all - basically ;

PHP Code:
function build_datastore($title ''$data '')
{

    if (
$title != '')
    {
        * DO 
STUFF *
    }


So if no parameters are supplied, it does nothing.
Reply With Quote
  #7  
Old 06-26-2005, 08:52 PM
futureal futureal is offline
 
Join Date: Feb 2002
Location: Del Mar, CA, USA
Posts: 556
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yea, pretty sure I'm not smoking crack.

I was writing a quick hack involving the datastore and happened to take a look at that function, just thought it was weird. My best guess is that it used to have some sort of debugging trace in there that they removed for the actual release.
Reply With Quote
  #8  
Old 06-26-2005, 10:24 PM
Link14716's Avatar
Link14716 Link14716 is offline
 
Join Date: Jun 2002
Location: Georgia, USA
Posts: 2,519
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I checked the 3.0.0 Beta 3 code and the function didn't even exist then. In fact, it didn't appear until 3.0.0 Release Candidate 4. The function is the same then as it is in 3.0.7. It looks to have changed a bit in 3.5.0, though, but not much.
Reply With Quote
  #9  
Old 06-26-2005, 10:27 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Link14716
I checked the 3.0.0 Beta 3 code and the function didn't even exist then. In fact, it didn't appear until 3.0.0 Release Candidate 4. The function is the same then as it is in 3.0.7. It looks to have changed a bit in 3.5.0, though, but not much.
Yep - but the change in 3.5.0 is still inside the IF - so it still will do nothing if no arguments are supplied.
Reply With Quote
  #10  
Old 06-26-2005, 10:37 PM
tamarian tamarian is offline
 
Join Date: Oct 2001
Location: Canada
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Note that there are a couple of functions called build_datastore, so keep an eye for the require_once line.
Reply With Quote
Reply

Thread Tools
Display Modes

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 02:18 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.04280 seconds
  • Memory Usage 2,251KB
  • Queries Executed 13 (?)
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)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete