From 66bb3c870e954a2d63183f20530415f344afdbc2 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Thu, 22 May 2008 17:28:54 +0000 Subject: [PATCH] wp_cache_add_global_groups() and wp_cache_add_non_persistent_groups(). fixes #6740 git-svn-id: https://develop.svn.wordpress.org/trunk@7986 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/cache.php | 33 ++++++++++++++++++++++++--------- wp-settings.php | 4 ++++ 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/wp-includes/cache.php b/wp-includes/cache.php index bb6cafa398..d1d0b3e259 100644 --- a/wp-includes/cache.php +++ b/wp-includes/cache.php @@ -137,6 +137,30 @@ function wp_cache_set($key, $data, $flag = '', $expire = 0) { return $wp_object_cache->set($key, $data, $flag, $expire); } +/** + * wp_cache_add_global_groups() - Adds a group or set of groups to the list of global groups + * + * @since 2.6 + * + * @param string|array $groups A group or an array of groups to add + */ +function wp_cache_add_global_groups( $groups ) { + // Default cache doesn't persist so nothing to do here. + return; +} + +/** + * wp_cache_add_non_persistent_groups() - Adds a group or set of groups to the list of non-persistent groups + * + * @since 2.6 + * + * @param string|array $groups A group or an array of groups to add + */ +function wp_cache_add_non_persistent_groups( $groups ) { + // Default cache doesn't persist so nothing to do here. + return; +} + /** * WordPress Object Cache * @@ -173,15 +197,6 @@ class WP_Object_Cache { */ var $non_existant_objects = array (); - /** - * Object caches that are global - * - * @var array - * @access private - * @since 2.0 - */ - var $global_groups = array ('users', 'userlogins', 'usermeta'); - /** * The amount of times the cache data was already stored in the cache. * diff --git a/wp-settings.php b/wp-settings.php index 791aada2eb..6bc4dc46ac 100644 --- a/wp-settings.php +++ b/wp-settings.php @@ -219,6 +219,10 @@ else require_once (ABSPATH . WPINC . '/cache.php'); wp_cache_init(); +if ( function_exists('wp_cache_add_global_groups') ) { + wp_cache_add_global_groups(array ('users', 'userlogins', 'usermeta')); + wp_cache_add_non_persistent_groups(array( 'comment', 'counts' )); +} require (ABSPATH . WPINC . '/plugin.php'); require (ABSPATH . WPINC . '/default-filters.php');