Set global is_blog_installed flag so we don't query the DB more than once per load.

git-svn-id: http://svn.automattic.com/wordpress/trunk@6244 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2007-10-13 18:39:28 +00:00
parent a8d380c32c
commit 16411f9c7b
1 changed files with 8 additions and 2 deletions

View File

@ -909,12 +909,18 @@ function do_robots() {
function is_blog_installed() {
global $wpdb;
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;
$wpdb->hide_errors();
$installed = $wpdb->get_var( "SELECT option_value FROM $wpdb->options WHERE option_name = 'siteurl'" );
$wpdb->show_errors();
return !empty( $installed );
$wp_is_blog_installed = !empty( $installed ) ? true : false;
return $wp_is_blog_installed;
}