Cache fixes for get_blog_details()
git-svn-id: http://svn.automattic.com/wordpress/trunk@14076 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
3c5115f15f
commit
5a76e8be5d
|
@ -125,14 +125,17 @@ function get_blog_details( $fields, $get_all = true ) {
|
|||
|
||||
if ( $details ) {
|
||||
if ( ! is_object( $details ) ) {
|
||||
if ( $details == -1 )
|
||||
if ( $details == -1 ) {
|
||||
return false;
|
||||
else
|
||||
} else {
|
||||
// Clear old pre-serialized objects. Cache clients do better with that.
|
||||
wp_cache_delete( $blog_id . $all, 'blog-details' );
|
||||
unset($details);
|
||||
}
|
||||
} else {
|
||||
return $details;
|
||||
}
|
||||
}
|
||||
|
||||
// Try the other cache.
|
||||
if ( $get_all ) {
|
||||
|
@ -142,18 +145,21 @@ function get_blog_details( $fields, $get_all = true ) {
|
|||
// If short was requested and full cache is set, we can return.
|
||||
if ( $details ) {
|
||||
if ( ! is_object( $details ) ) {
|
||||
if ( $details == -1 )
|
||||
if ( $details == -1 ) {
|
||||
return false;
|
||||
else
|
||||
} else {
|
||||
// Clear old pre-serialized objects. Cache clients do better with that.
|
||||
wp_cache_delete( $blog_id . $all, 'blog-details' );
|
||||
wp_cache_delete( $blog_id, 'blog-details' );
|
||||
unset($details);
|
||||
}
|
||||
} else {
|
||||
return $details;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( !$details ) {
|
||||
$details = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->blogs WHERE blog_id = %d", $blog_id ) );
|
||||
if ( empty($details) ) {
|
||||
$details = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->blogs WHERE blog_id = %d /* get_blog_details */", $blog_id ) );
|
||||
if ( ! $details ) {
|
||||
// Set the full cache.
|
||||
wp_cache_set( $blog_id, -1, 'blog-details' );
|
||||
|
|
Loading…
Reference in New Issue