From bb3e16e9745abc5d625a8254303c3875c7a04ebf Mon Sep 17 00:00:00 2001 From: donncha Date: Mon, 8 Jan 2007 18:25:37 +0000 Subject: WP Merge to 4701 git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@832 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-includes/cache.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'wp-includes/cache.php') diff --git a/wp-includes/cache.php b/wp-includes/cache.php index 6880624..b4c5b89 100644 --- a/wp-includes/cache.php +++ b/wp-includes/cache.php @@ -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(); } @@ -415,8 +417,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; @@ -451,5 +459,10 @@ class WP_Object_Cache { $this->blog_id = $this->hash($blog_id); } + + function __destruct() { + $this->save(); + return true; + } } ?> -- cgit