From c77a783d557c12ca1858ba039cf6abcf5f1f28ce Mon Sep 17 00:00:00 2001 From: Ryan Boren 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: https://develop.svn.wordpress.org/trunk@6249 602fd350-edb4-49c9-b593-d223f7449a82 --- 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 2facb14759..5f0113b34c 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; }