From d3ab0af45aaa6a0135b497df0d7657635de900ab Mon Sep 17 00:00:00 2001 From: donncha Date: Fri, 7 Jul 2006 13:58:34 +0000 Subject: Added is_switched() Only store "novalueindb" values for 5 seconds git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@642 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-includes/functions.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'wp-includes') diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 30a5360..294d469 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -164,10 +164,20 @@ function maybe_unserialize($original) { /* Options functions */ +function is_switched( $setting = 'N/A' ) { + global $switched; + if ( $switched == false && defined('WP_INSTALLING') == false && $_REQUEST['nomemcache'] != 'all' && $_REQUEST['nomemcache'] != $setting ) { + return false; + } else { + return true; + } + +} + function get_settings($setting) { global $wpdb, $switched, $current_blog; - if ( $switched == false && defined('WP_INSTALLING') == false && $_REQUEST['nomemcache'] != 'all' && $_REQUEST['nomemcache'] != $setting ) { + if ( is_switched() == false ) { $value = wp_cache_get($setting, 'options'); } else { $value = false; @@ -194,7 +204,7 @@ function get_settings($setting) { $value = $row->option_value; wp_cache_set($setting, ($value=='')?'emptystringindb':$value, 'options'); } else { - wp_cache_set($setting, 'novalueindb', 'options'); + wp_cache_set($setting, 'novalueindb', 'options', 5); return false; } } -- cgit