vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Why build_datastore with no arguments? (https://vborg.vbsupport.ru/showthread.php?t=91096)

futureal 06-26-2005 02:21 AM

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. :)

Link14716 06-26-2005 03:37 AM

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? ;)

Xenon 06-26-2005 05:20 PM

very good question.

maybe it was planned to update the datastore chache when running it without parameters, but they forgot it or decided otherwise..

Revan 06-26-2005 06:52 PM

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.

Andreas 06-26-2005 06:58 PM

At least in 3.0.7 and 3.5.0 Beta 2 a call to build_datastore() without arguments does nothing.

Paul M 06-26-2005 07:11 PM

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.

futureal 06-26-2005 08:52 PM

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.

Link14716 06-26-2005 10:24 PM

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.

Paul M 06-26-2005 10:27 PM

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.

tamarian 06-26-2005 10:37 PM

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


All times are GMT. The time now is 10:28 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.01153 seconds
  • Memory Usage 1,736KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete