From 58e47dcb4a0dfdfb264f3feef4e68448048d5463 Mon Sep 17 00:00:00 2001 From: ryan 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: http://svn.automattic.com/wordpress/trunk@7986 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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 bb6cafa39..d1d0b3e25 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 791aada2e..6bc4dc46a 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');