vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   what does shutdown_query do? (https://vborg.vbsupport.ru/showthread.php?t=75222)

sabret00the 01-27-2005 10:29 AM

what does shutdown_query do?
 
PHP Code:

$DB_site->shutdown_query(

just wondering what this does as opposed to ->query_first and ->query

Creative Suite 01-27-2005 11:45 AM

PHP Code:

    function shutdown_query($query_string$arraykey 0)
    {
        global 
$shutdownqueries;

        if (
NOSHUTDOWNFUNC AND !$arraykey)
        {
            return 
$this->query($query_string);
        }
        elseif (
$arraykey)
        {
            
$shutdownqueries["$arraykey"] = $query_string;
        }
        else
        {
            
$shutdownqueries[] = $query_string;
        }
    } 


sabret00the 01-27-2005 11:52 AM

that went right over my head.

let's simplify

->query( // you'd use for a loop
->query_first( // standard query
->shutdown_query( // ???

Dean C 01-27-2005 12:15 PM

You know what, I have absolutely no idea. It appears that it's a feature designed to run queries after the page has rendered. All the queries in shutdown queries are not run at that particular part of the script I can tell you that. If you look at exec_shut_down() in functions.php you'll see what happens. However, I can't find any reference to that function being run anywhere in any of the vB files :)

Who knows... maybe I'm overlooking something

Marco van Herwaarden 01-27-2005 12:20 PM

Lol, you should read the how-to's :D

https://vborg.vbsupport.ru/showthread.php?t=75207

With great thanks to Bruce.Lee :D :D

Dean C 01-27-2005 12:25 PM

I just checked again, and that function is not being called anywhere according to ultraedit!

Andreas 01-27-2005 12:34 PM

And I thought UltraEdit was a good software ^.^

admincp/global.php
PHP Code:

    if (!empty($cpsession))
    {
        
$DB_site->shutdown_query("
            UPDATE LOW_PRIORITY " 
TABLE_PREFIX "cpsession
            SET dateline = " 
TIMENOW "
            WHERE userid = 
$bbuserinfo[userid]
                AND hash = '" 
addslashes($_COOKIE[COOKIE_PREFIX 'cpsession']) . "'
        "
); 

announcement.php
PHP Code:

if ($anncids)
{
    
$DB_site->shutdown_query("
        UPDATE " 
TABLE_PREFIX "announcement
        SET views = views + 1
        WHERE announcementid IN (
$anncids)
    "
);


attachment.php
PHP Code:

        // doing it as they happen
        
$DB_site->shutdown_query("
            UPDATE " 
TABLE_PREFIX "attachment
            SET counter = counter + 1
            WHERE attachmentid = 
$attachmentinfo[attachmentid]
        "
); 

and so on.

Or did you mean exec_shut_down?

functions.php
PHP Code:

if (!NOSHUTDOWNFUNC)
{
    
register_shutdown_function('exec_shut_down');


PHP Code:

    if (NOSHUTDOWNFUNC)
    {
        
exec_shut_down();
    } 


Dean C 01-27-2005 12:39 PM

No no no no.... ;)

Ok those queries are passed to the method with db_mysql.php, and either ran at that exact time or stored in an array. This array is then released by the method with a global call and acn be used anywhere else in the script. There is then no reference to where-else these queries are ran. So they must be run at that exact point in the script. Do a search for $shutdownqueries and you tell me where they are run, in exec_shut_down. Ok then tell me where this function is ran ;)

Follow?

Andreas 01-27-2005 12:40 PM

Revised my last post to include the references for exec_shut_down

Dean C 01-27-2005 12:57 PM

Weird I don't have those lines in my functions.php?


All times are GMT. The time now is 06:04 AM.

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.01216 seconds
  • Memory Usage 1,753KB
  • 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
  • (7)bbcode_php_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