Changeset 25289 for trunk/src/wp-includes/load.php
- Timestamp:
- 09/06/2013 06:09:24 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/load.php
r24581 r25289 371 371 372 372 /** 373 * Access/Modify private global variable $_wp_using_ext_object_cache 374 * 375 * Toggle $_wp_using_ext_object_cache on and off without directly touching global 376 * 377 * @since 3.7.0 378 * 379 * @param bool $using Whether external object cache is being used 380 * @return bool The current 'using' setting 381 */ 382 function wp_using_ext_object_cache( $using = null ) { 383 global $_wp_using_ext_object_cache; 384 $current_using = $_wp_using_ext_object_cache; 385 if ( null !== $using ) 386 $_wp_using_ext_object_cache = $using; 387 return $current_using; 388 } 389 390 /** 373 391 * Starts the WordPress object cache. 374 392 * … … 380 398 */ 381 399 function wp_start_object_cache() { 382 global $ _wp_using_ext_object_cache, $blog_id;400 global $blog_id; 383 401 384 402 $first_init = false; … … 386 404 if ( file_exists( WP_CONTENT_DIR . '/object-cache.php' ) ) { 387 405 require_once ( WP_CONTENT_DIR . '/object-cache.php' ); 388 $_wp_using_ext_object_cache = true; 389 } else { 390 require_once ( ABSPATH . WPINC . '/cache.php' ); 391 $_wp_using_ext_object_cache = false; 406 if ( function_exists( 'wp_cache_init' ) ) 407 wp_using_ext_object_cache( true ); 392 408 } 409 393 410 $first_init = true; 394 } else if ( ! $_wp_using_ext_object_cache&& file_exists( WP_CONTENT_DIR . '/object-cache.php' ) ) {411 } else if ( ! wp_using_ext_object_cache() && file_exists( WP_CONTENT_DIR . '/object-cache.php' ) ) { 395 412 // Sometimes advanced-cache.php can load object-cache.php before it is loaded here. 396 413 // This breaks the function_exists check above and can result in $_wp_using_ext_object_cache 397 414 // being set incorrectly. Double check if an external cache exists. 398 $_wp_using_ext_object_cache = true; 399 } 415 wp_using_ext_object_cache( true ); 416 } 417 418 if ( ! wp_using_ext_object_cache() ) 419 require_once ( ABSPATH . WPINC . '/cache.php' ); 400 420 401 421 // If cache supports reset, reset instead of init if already initialized. … … 404 424 if ( ! $first_init && function_exists( 'wp_cache_switch_to_blog' ) ) 405 425 wp_cache_switch_to_blog( $blog_id ); 406 else 426 elseif ( function_exists( 'wp_cache_init' ) ) 407 427 wp_cache_init(); 408 428
Note: See TracChangeset
for help on using the changeset viewer.