From 808cd79992ba1fcf7003b8e7b9e5ae63a9fe7b3d Mon Sep 17 00:00:00 2001 From: ryan Date: Sun, 14 Oct 2007 07:57:56 +0000 Subject: [PATCH] Just cache the is_blog_installed value. If the options table goes away while the value is still cached, oh well. Very edge-case. git-svn-id: http://svn.automattic.com/wordpress/trunk@6249 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 2facb1475..5f0113b34 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -911,16 +911,18 @@ function do_robots() { function is_blog_installed() { global $wpdb, $wp_is_blog_installed; - // Set flag so we don't do the query more than once. - if ( isset($wp_is_blog_installed) ) - return $wp_is_blog_installed; + // Check cache first. If options table goes away and we have true cached, oh well. + if ( wp_cache_get('is_blog_installed') ) + return true; $wpdb->hide_errors(); $installed = $wpdb->get_var( "SELECT option_value FROM $wpdb->options WHERE option_name = 'siteurl'" ); $wpdb->show_errors(); - $wp_is_blog_installed = !empty( $installed ) ? true : false; - return $wp_is_blog_installed; + $installed = !empty( $installed ) ? true : false; + wp_cache_set('is_blog_installed', $installed); + + return $installed; }