mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-03-22 22:34:30 +00:00
Fiddle with object destruction and shutdown. Curses upon php 5.2. fixes #3354
git-svn-id: https://develop.svn.wordpress.org/trunk@4686 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -8,6 +8,8 @@ function wp_cache_add($key, $data, $flag = '', $expire = 0) {
|
||||
function wp_cache_close() {
|
||||
global $wp_object_cache;
|
||||
|
||||
if ( ! isset($wp_object_cache) )
|
||||
return;
|
||||
return $wp_object_cache->save();
|
||||
}
|
||||
|
||||
@@ -392,8 +394,14 @@ class WP_Object_Cache {
|
||||
}
|
||||
|
||||
function WP_Object_Cache() {
|
||||
return $this->__construct();
|
||||
}
|
||||
|
||||
function __construct() {
|
||||
global $blog_id;
|
||||
|
||||
register_shutdown_function(array(&$this, "__destruct"));
|
||||
|
||||
if (defined('DISABLE_CACHE'))
|
||||
return;
|
||||
|
||||
@@ -428,5 +436,10 @@ class WP_Object_Cache {
|
||||
|
||||
$this->blog_id = $this->hash($blog_id);
|
||||
}
|
||||
|
||||
function __destruct() {
|
||||
$this->save();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user