Ticket #5389: cache_suspend.diff
File cache_suspend.diff, 2.3 KB (added by , 16 years ago) |
---|
-
wp-includes/cache.php
43 43 return $wp_object_cache->replace($key, $data, $flag, $expire); 44 44 } 45 45 46 function wp_cache_resume() { 47 global $wp_object_cache; 48 49 $wp_object_cache->cache_suspended = false; 50 } 51 46 52 function wp_cache_set($key, $data, $flag = '', $expire = 0) { 47 53 global $wp_object_cache; 48 54 $data = unserialize(serialize($data)); … … 50 56 return $wp_object_cache->set($key, $data, $flag, $expire); 51 57 } 52 58 59 function wp_cache_suspend() { 60 global $wp_object_cache; 61 62 $wp_object_cache->cache_suspended = true; 63 } 64 53 65 define('CACHE_SERIAL_HEADER', "<?php\n/*"); 54 66 define('CACHE_SERIAL_FOOTER', "*/\n?".">"); 55 67 56 68 class WP_Object_Cache { 57 69 var $cache_dir; 58 70 var $cache_enabled = false; 71 var $cache_suspended = false; 59 72 var $expiration_time = 900; 60 73 var $flock_filename = 'wp_object_cache.lock'; 61 74 var $mutex; … … 120 133 } 121 134 122 135 function get($id, $group = 'default', $count_hits = true) { 136 if ( $this->cache_suspended ) 137 return false; 138 123 139 if (empty ($group)) 124 140 $group = 'default'; 125 141 … … 264 280 } 265 281 266 282 function set($id, $data, $group = 'default', $expire = '') { 283 if ( $this->cache_suspended ) 284 return true; 285 267 286 if (empty ($group)) 268 287 $group = 'default'; 269 288 -
wp-admin/includes/upgrade.php
11 11 12 12 wp_check_mysql_version(); 13 13 wp_cache_flush(); 14 wp_cache_suspend(); 14 15 make_db_current_silent(); 15 16 populate_options(); 16 17 populate_roles(); … … 50 51 51 52 wp_new_blog_notification($blog_title, $guessurl, $user_id, $random_password); 52 53 53 wp_cache_flush();54 55 54 return array('url' => $guessurl, 'user_id' => $user_id, 'password' => $random_password); 56 55 } 57 56 endif; -
wp-admin/admin.php
97 97 require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); 98 98 99 99 define('WP_IMPORTING', true); 100 wp_cache_suspend(); 100 101 101 102 call_user_func($wp_importers[$importer][2]); 102 103