Ticket #37464: 37464.1.diff
| File 37464.1.diff, 6.1 KB (added by , 10 years ago) |
|---|
-
src/wp-includes/class-wp-comment-query.php
393 393 394 394 // $args can include anything. Only use the args defined in the query_var_defaults to compute the key. 395 395 $key = md5( serialize( wp_array_slice_assoc( $this->query_vars, array_keys( $this->query_var_defaults ) ) ) ); 396 $last_changed = wp_cache_get( 'last_changed', 'comment' ); 397 if ( ! $last_changed ) { 398 $last_changed = microtime(); 399 wp_cache_set( 'last_changed', $last_changed, 'comment' ); 400 } 396 $last_changed = wp_get_last_changed( 'comment' ); 401 397 398 402 399 $cache_key = "get_comments:$key:$last_changed"; 403 400 $cache_value = wp_cache_get( $cache_key, 'comment' ); 404 401 if ( false === $cache_value ) { … … 972 969 } 973 970 974 971 $key = md5( serialize( wp_array_slice_assoc( $this->query_vars, array_keys( $this->query_var_defaults ) ) ) ); 975 $last_changed = wp_cache_get( 'last_changed', 'comment' ); 976 if ( ! $last_changed ) { 977 $last_changed = microtime(); 978 wp_cache_set( 'last_changed', $last_changed, 'comment' ); 979 } 972 $last_changed = wp_get_last_changed( 'comment' ); 980 973 981 974 // Fetch an entire level of the descendant tree at a time. 982 975 $level = 0; -
src/wp-includes/class-wp-network-query.php
211 211 212 212 // $args can include anything. Only use the args defined in the query_var_defaults to compute the key. 213 213 $key = md5( serialize( wp_array_slice_assoc( $this->query_vars, array_keys( $this->query_var_defaults ) ) ) ); 214 $last_changed = wp_cache_get( 'last_changed', 'networks' ); 215 if ( ! $last_changed ) { 216 $last_changed = microtime(); 217 wp_cache_set( 'last_changed', $last_changed, 'networks' ); 218 } 214 $last_changed = wp_get_last_changed( 'networks' ); 219 215 220 216 $cache_key = "get_network_ids:$key:$last_changed"; 221 217 $cache_value = wp_cache_get( $cache_key, 'networks' ); -
src/wp-includes/class-wp-site-query.php
247 247 248 248 // $args can include anything. Only use the args defined in the query_var_defaults to compute the key. 249 249 $key = md5( serialize( wp_array_slice_assoc( $this->query_vars, array_keys( $this->query_var_defaults ) ) ) ); 250 $last_changed = wp_cache_get( 'last_changed', 'sites' ); 251 if ( ! $last_changed ) { 252 $last_changed = microtime(); 253 wp_cache_set( 'last_changed', $last_changed, 'sites' ); 254 } 250 $last_changed = wp_get_last_changed( 'sites' ); 255 251 256 252 $cache_key = "get_sites:$key:$last_changed"; 257 253 $cache_value = wp_cache_get( $cache_key, 'sites' ); -
src/wp-includes/class-wp-term-query.php
629 629 630 630 // $args can be anything. Only use the args defined in defaults to compute the key. 631 631 $key = md5( serialize( wp_array_slice_assoc( $args, array_keys( $this->query_var_defaults ) ) ) . serialize( $taxonomies ) . $this->request ); 632 $last_changed = wp_cache_get( 'last_changed', 'terms' ); 633 if ( ! $last_changed ) { 634 $last_changed = microtime(); 635 wp_cache_set( 'last_changed', $last_changed, 'terms' ); 636 } 632 $last_changed = wp_get_last_changed( 'terms' ); 637 633 $cache_key = "get_terms:$key:$last_changed"; 638 634 $cache = wp_cache_get( $cache_key, 'terms' ); 639 635 if ( false !== $cache ) { -
src/wp-includes/functions.php
5463 5463 5464 5464 return false; 5465 5465 } 5466 5467 /** 5468 * Get last changed value from cache group 5469 * 5470 * @param $group 5471 * @return string $last_changed 5472 */ 5473 function wp_get_last_changed( $group ){ 5474 $last_changed = wp_cache_get( 'last_changed', $group ); 5475 if ( ! $last_changed ) { 5476 $last_changed = microtime(); 5477 wp_cache_set( 'last_changed', $last_changed, $group ); 5478 } 5479 return $last_changed; 5480 } 5481 No newline at end of file -
src/wp-includes/general-template.php
1698 1698 1699 1699 $output = ''; 1700 1700 1701 $last_changed = wp_cache_get( 'last_changed', 'posts' ); 1702 if ( ! $last_changed ) { 1703 $last_changed = microtime(); 1704 wp_cache_set( 'last_changed', $last_changed, 'posts' ); 1705 } 1701 $last_changed = wp_get_last_changed( 'posts' ); 1706 1702 1707 1703 $limit = $r['limit']; 1708 1704 -
src/wp-includes/post.php
4098 4098 function get_page_by_path( $page_path, $output = OBJECT, $post_type = 'page' ) { 4099 4099 global $wpdb; 4100 4100 4101 $last_changed = wp_cache_get( 'last_changed', 'posts' ); 4102 if ( false === $last_changed ) { 4103 $last_changed = microtime(); 4104 wp_cache_set( 'last_changed', $last_changed, 'posts' ); 4105 } 4101 $last_changed = wp_get_last_changed( 'posts' ); 4106 4102 4107 4103 $hash = md5( $page_path . serialize( $post_type ) ); 4108 4104 $cache_key = "get_page_by_path:$hash:$last_changed"; … … 4436 4432 4437 4433 // $args can be whatever, only use the args defined in defaults to compute the key. 4438 4434 $key = md5( serialize( wp_array_slice_assoc( $r, array_keys( $defaults ) ) ) ); 4439 $last_changed = wp_cache_get( 'last_changed', 'posts' ); 4440 if ( ! $last_changed ) { 4441 $last_changed = microtime(); 4442 wp_cache_set( 'last_changed', $last_changed, 'posts' ); 4443 } 4435 $last_changed = wp_get_last_changed( 'posts' ); 4444 4436 4445 4437 $cache_key = "get_pages:$key:$last_changed"; 4446 4438 if ( $cache = wp_cache_get( $cache_key, 'posts' ) ) {