Changeset 971

Show
Ignore:
Timestamp:
04/18/07 15:15:33 (2 years ago)
Author:
donncha
Message:

change wp_cache_set to wp_cache_add

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-includes/wpmu-functions.php

    r960 r971  
    176176                $wpdb->show_errors(); 
    177177 
    178                 wp_cache_set( $id, serialize( $details ), 'blog-details' ); 
     178                wp_cache_add( $id, serialize( $details ), 'blog-details' ); 
    179179 
    180180                $key = md5( $details->domain . $details->path ); 
    181                 wp_cache_set( $key, serialize( $details ), 'blog-lookup' ); 
     181                wp_cache_add( $key, serialize( $details ), 'blog-lookup' ); 
    182182        } 
    183183 
     
    232232                $value = $wpdb->get_var("SELECT meta_value FROM $wpdb->sitemeta WHERE meta_key = '$key' AND site_id = '{$wpdb->siteid}'"); 
    233233                if ( ! is_null($value) ) { 
    234                         wp_cache_set($wpdb->siteid . $key, $value, 'site-options'); 
     234                        wp_cache_add($wpdb->siteid . $key, $value, 'site-options'); 
    235235                } elseif ( $default ) { 
     236                        wp_cache_add($wpdb->siteid . $key, $default, 'site-options'); 
    236237                        return $default; 
    237238                } else { 
     239                        wp_cache_add($wpdb->siteid . $key, false, 'site-options'); 
    238240                        return false; 
    239241                } 
     
    470472                                $blogs[$match[1]]->domain      = $blog->domain; 
    471473                                $blogs[$match[1]]->path        = $blog->path; 
     474                                $blogs[$match[1]]->site_id     = $blog->site_id; 
    472475                        } 
    473476                } 
     
    669672        if( $post == false ) { 
    670673                $post = $wpdb->get_row( "SELECT * FROM {$wpmuBaseTablePrefix}{$blog_id}_posts WHERE ID = '{$post_id}'" ); 
    671                 wp_cache_set( $key, $post, "site-options", 120 ); 
     674                wp_cache_add( $key, $post, "site-options", 120 ); 
    672675        } 
    673676 
     
    785788                $link = get_permalink( $post_id ); 
    786789                restore_current_blog(); 
    787                 wp_cache_set( $key, $link, "site-options", 30 ); 
     790                wp_cache_add( $key, $link, "site-options", 30 ); 
    788791        } 
    789792        return $link;