Make WordPress Core


Ignore:
Timestamp:
01/30/2007 06:33:48 PM (18 years ago)
Author:
markjaquith
Message:

Fiddle with object destruction and shutdown. Curses upon php 5.2. fixes #3354

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0/wp-includes/cache.php

    r4487 r4841  
    99    global $wp_object_cache;
    1010
     11    if ( ! isset($wp_object_cache) )
     12        return;
    1113    return $wp_object_cache->save();
    1214}
     
    403405
    404406    function WP_Object_Cache() {
     407        return $this->__construct();
     408    }
     409   
     410    function __construct() {
    405411        global $blog_id;
     412
     413        register_shutdown_function(array(&$this, "__destruct"));
    406414
    407415        if (defined('DISABLE_CACHE'))
     
    439447        $this->blog_id = $this->hash($blog_id);
    440448    }
     449
     450    function __destruct() {
     451        $this->save();
     452        return true;   
     453    }
    441454}
    442455?>
Note: See TracChangeset for help on using the changeset viewer.