Ticket #37464: 37464.2.diff
| File 37464.2.diff, 6.3 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_cache_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_cache_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
209 209 210 210 // $args can include anything. Only use the args defined in the query_var_defaults to compute the key. 211 211 $key = md5( serialize( wp_array_slice_assoc( $this->query_vars, array_keys( $this->query_var_defaults ) ) ) ); 212 $last_changed = wp_cache_get( 'last_changed', 'networks' ); 213 if ( ! $last_changed ) { 214 $last_changed = microtime(); 215 wp_cache_set( 'last_changed', $last_changed, 'networks' ); 216 } 212 $last_changed = wp_cache_get_last_changed( 'networks' ); 217 213 218 214 $cache_key = "get_network_ids:$key:$last_changed"; 219 215 $cache_value = wp_cache_get( $cache_key, 'networks' ); -
src/wp-includes/class-wp-site-query.php
245 245 246 246 // $args can include anything. Only use the args defined in the query_var_defaults to compute the key. 247 247 $key = md5( serialize( wp_array_slice_assoc( $this->query_vars, array_keys( $this->query_var_defaults ) ) ) ); 248 $last_changed = wp_cache_get( 'last_changed', 'sites' ); 249 if ( ! $last_changed ) { 250 $last_changed = microtime(); 251 wp_cache_set( 'last_changed', $last_changed, 'sites' ); 252 } 248 $last_changed = wp_cache_get_last_changed( 'sites' ); 253 249 254 250 $cache_key = "get_sites:$key:$last_changed"; 255 251 $cache_value = wp_cache_get( $cache_key, 'sites' ); -
src/wp-includes/class-wp-term-query.php
673 673 674 674 // $args can be anything. Only use the args defined in defaults to compute the key. 675 675 $key = md5( serialize( wp_array_slice_assoc( $args, array_keys( $this->query_var_defaults ) ) ) . serialize( $taxonomies ) . $this->request ); 676 $last_changed = wp_cache_get( 'last_changed', 'terms' ); 677 if ( ! $last_changed ) { 678 $last_changed = microtime(); 679 wp_cache_set( 'last_changed', $last_changed, 'terms' ); 680 } 676 $last_changed = wp_cache_get_last_changed( 'terms' ); 681 677 $cache_key = "get_terms:$key:$last_changed"; 682 678 $cache = wp_cache_get( $cache_key, 'terms' ); 683 679 if ( false !== $cache ) { -
src/wp-includes/functions.php
5529 5529 5530 5530 return false; 5531 5531 } 5532 5533 /** 5534 * Get last changed date for the specified cache group. 5535 * 5536 * @since 4.7.0 5537 * 5538 * @param $group Where the cache contents are grouped. 5539 * 5540 * @return string $last_changed UNIX timestamp with microseconds representing when the group was last changed. 5541 */ 5542 function wp_cache_get_last_changed( $group ) { 5543 $last_changed = wp_cache_get( 'last_changed', $group ); 5544 5545 if ( ! $last_changed ) { 5546 $last_changed = microtime(); 5547 wp_cache_set( 'last_changed', $last_changed, $group ); 5548 } 5549 5550 return $last_changed; 5551 } 5552 No newline at end of file -
src/wp-includes/general-template.php
1705 1705 1706 1706 $output = ''; 1707 1707 1708 $last_changed = wp_cache_get( 'last_changed', 'posts' ); 1709 if ( ! $last_changed ) { 1710 $last_changed = microtime(); 1711 wp_cache_set( 'last_changed', $last_changed, 'posts' ); 1712 } 1708 $last_changed = wp_cache_get_last_changed( 'posts' ); 1713 1709 1714 1710 $limit = $r['limit']; 1715 1711 -
src/wp-includes/post.php
4111 4111 function get_page_by_path( $page_path, $output = OBJECT, $post_type = 'page' ) { 4112 4112 global $wpdb; 4113 4113 4114 $last_changed = wp_cache_get( 'last_changed', 'posts' ); 4115 if ( false === $last_changed ) { 4116 $last_changed = microtime(); 4117 wp_cache_set( 'last_changed', $last_changed, 'posts' ); 4118 } 4114 $last_changed = wp_cache_get_last_changed( 'posts' ); 4119 4115 4120 4116 $hash = md5( $page_path . serialize( $post_type ) ); 4121 4117 $cache_key = "get_page_by_path:$hash:$last_changed"; … … 4449 4445 4450 4446 // $args can be whatever, only use the args defined in defaults to compute the key. 4451 4447 $key = md5( serialize( wp_array_slice_assoc( $r, array_keys( $defaults ) ) ) ); 4452 $last_changed = wp_cache_get( 'last_changed', 'posts' ); 4453 if ( ! $last_changed ) { 4454 $last_changed = microtime(); 4455 wp_cache_set( 'last_changed', $last_changed, 'posts' ); 4456 } 4448 $last_changed = wp_cache_get_last_changed( 'posts' ); 4457 4449 4458 4450 $cache_key = "get_pages:$key:$last_changed"; 4459 4451 if ( $cache = wp_cache_get( $cache_key, 'posts' ) ) {