Ticket #5389: 5389.patch
File 5389.patch, 3.5 KB (added by , 13 years ago) |
---|
-
wp-admin/admin.php
202 202 require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); 203 203 204 204 define('WP_IMPORTING', true); 205 wp_cache_suspend(); 205 206 206 207 if ( apply_filters( 'force_filtered_html_on_import', false ) ) 207 208 kses_init_filters(); // Always filter imported data with kses on multisite. -
wp-admin/includes/upgrade.php
42 42 43 43 wp_check_mysql_version(); 44 44 wp_cache_flush(); 45 wp_cache_suspend(); 45 46 make_db_current_silent(); 46 47 populate_options(); 47 48 populate_roles(); … … 86 87 87 88 wp_new_blog_notification($blog_title, $guessurl, $user_id, ($email_password ? $user_password : __('The password you chose during the install.') ) ); 88 89 89 wp_cache_flush();90 91 90 return array('url' => $guessurl, 'user_id' => $user_id, 'password' => $user_password, 'password_message' => $message); 92 91 } 93 92 endif; … … 362 361 363 362 wp_check_mysql_version(); 364 363 wp_cache_flush(); 364 wp_cache_suspend(); 365 365 pre_schema_upgrade(); 366 366 make_db_current_silent(); 367 367 upgrade_all(); 368 368 if ( is_multisite() && is_main_site() ) 369 369 upgrade_network(); 370 wp_cache_flush();371 370 372 371 if ( is_multisite() ) { 373 372 if ( $wpdb->get_row( "SELECT blog_id FROM {$wpdb->blog_versions} WHERE blog_id = '{$wpdb->blogid}'" ) ) -
wp-includes/cache.php
278 278 var $global_groups = array(); 279 279 280 280 /** 281 * If the cache is suspended for performance reasons 282 * 283 * @var bool 284 * @access private 285 * @since 3.3.0 286 */ 287 var $cache_suspended = false; 288 289 /** 281 290 * Adds data to the cache if it doesn't already exist. 282 291 * 283 292 * @uses WP_Object_Cache::get Checks to see if the cache already has data. … … 293 302 * @return bool False if cache ID and group already exists, true on success 294 303 */ 295 304 function add( $id, $data, $group = 'default', $expire = '' ) { 305 if ( $this->cache_suspended ) 306 return true; 307 296 308 if ( empty ($group) ) 297 309 $group = 'default'; 298 310 … … 509 521 * @return bool Always returns true 510 522 */ 511 523 function set($id, $data, $group = 'default', $expire = '') { 524 if ( $this->cache_suspended ) 525 return true; 526 512 527 if ( empty ($group) ) 513 528 $group = 'default'; 514 529 -
wp-includes/functions.php
3700 3700 } 3701 3701 3702 3702 /** 3703 * Suspend object caching. 3704 * 3705 * Stops wp_cache_add() from adding objects to the cache. Useful for imports when 3706 * the huge amount of data being added to cache isn't useful. Call wp_cache_resume() later 3707 * if you want suspension to only be temporary. 3708 * 3709 * @since 3.3.0 3710 */ 3711 function wp_cache_suspend() { 3712 global $wp_object_cache; 3713 3714 if ( !empty( $wp_object_cache ) ) 3715 $wp_object_cache->cache_suspended = true; 3716 } 3717 3718 /** 3719 * Resume object caching. 3720 * 3721 * @since 3.3.0 3722 */ 3723 function wp_cache_resume() { 3724 global $wp_object_cache; 3725 3726 if ( !empty( $wp_object_cache ) ) 3727 $wp_object_cache->cache_suspended = false; 3728 } 3729 3730 /** 3703 3731 * Suspend cache invalidation. 3704 3732 * 3705 3733 * Turns cache invalidation on and off. Useful during imports where you don't wont to do invalidations