Flush the cache before installing. fixes #1877

git-svn-id: http://svn.automattic.com/wordpress/trunk@3088 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2005-11-14 22:32:03 +00:00
parent 08fea3c335
commit a3a84d2957
2 changed files with 86 additions and 78 deletions

View File

@ -137,6 +137,7 @@ if (empty($admin_email)) {
flush();
// Set everything up
wp_cache_flush();
make_db_current_silent();
populate_options();
populate_roles();
@ -198,6 +199,7 @@ http://wordpress.org/
@wp_mail($admin_email, __('New WordPress Blog'), $message, $message_headers);
wp_cache_flush();
?>
<p><em><?php _e('Finished!'); ?></em></p>

View File

@ -91,7 +91,11 @@ class WP_Object_Cache {
}
function flush() {
return $this->rm($this->cache_dir . '*');
$this->rm($this->cache_dir.'*');
$this->cache = array ();
$this->dirty_objects = array ();
$this->non_existant_objects = array ();
return true;
}
function get($id, $group = 'default', $count_hits = true) {
@ -172,7 +176,8 @@ class WP_Object_Cache {
$this->cache['category'][$catt->cat_ID]->fullpath = $fullpath;
}
}
} else if ( 'options' == $group ) {
} else
if ('options' == $group) {
$wpdb->hide_errors();
if (!$options = $wpdb->get_results("SELECT option_name, option_value FROM $wpdb->options WHERE autoload = 'yes'")) {
$options = $wpdb->get_results("SELECT option_name, option_value FROM $wpdb->options");
@ -207,11 +212,11 @@ class WP_Object_Cache {
function rm($fileglob) {
if (is_file($fileglob)) {
return @ unlink($fileglob);
} else if (is_dir($fileglob)) {
$ok = $this->rm("$fileglob/*");
if (! $ok) {
} else
if (is_dir($fileglob)) {
$ok = WP_Object_Cache::rm("$fileglob/*");
if (!$ok)
return false;
}
return @ rmdir($fileglob);
} else {
$matching = glob($fileglob);
@ -357,7 +362,8 @@ class WP_Object_Cache {
if (is_dir($this->cache_dir)) {
if (is_writable($this->cache_dir))
$this->cache_enabled = true;
} else if (is_writable(ABSPATH.'wp-content')) {
} else
if (is_writable(ABSPATH.'wp-content')) {
$this->cache_enabled = true;
}