diff options
| author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-01-08 18:25:37 +0000 |
|---|---|---|
| committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-01-08 18:25:37 +0000 |
| commit | bb3e16e9745abc5d625a8254303c3875c7a04ebf (patch) | |
| tree | 105f7abc052be575a643971ab59b3b38f4fa7056 /wp-includes/cache.php | |
| parent | 11571c1befd735bd1d69caea2b093164215b4fee (diff) | |
| download | wordpress-mu-bb3e16e9745abc5d625a8254303c3875c7a04ebf.tar.gz wordpress-mu-bb3e16e9745abc5d625a8254303c3875c7a04ebf.tar.xz wordpress-mu-bb3e16e9745abc5d625a8254303c3875c7a04ebf.zip | |
WP Merge to 4701
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@832 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/cache.php')
| -rw-r--r-- | wp-includes/cache.php | 13 |
1 files changed, 13 insertions, 0 deletions
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;
+ }
}
?>
|
