From 42ceb32c0bc6281f325672c4b4c94163bdd9ac1d Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 28 Aug 2008 07:09:46 +0000 Subject: [PATCH] Upgrade db with remote post during core update. see #5560 git-svn-id: http://svn.automattic.com/wordpress/trunk@8759 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/update-core.php | 9 ++------- wp-admin/upgrade.php | 13 +++++++++++-- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/wp-admin/includes/update-core.php b/wp-admin/includes/update-core.php index f305ed42d..1297744bf 100644 --- a/wp-admin/includes/update-core.php +++ b/wp-admin/includes/update-core.php @@ -199,13 +199,8 @@ function update_core($from, $to) { // Might have to do upgrade in a separate step. apply_filters('update_feedback', __('Upgrading database')); - // Get new db version - global $wp_db_version; - require (ABSPATH . WPINC . '/version.php'); - // Upgrade db - define('WP_INSTALLING', true); - require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); - wp_upgrade(); + $db_upgrade_url = admin_url('upgrade.php?step=upgrade_db'); + wp_remote_post($db_upgrade_url, array('timeout' => 60)); // Remove working directory $wp_filesystem->delete($from, true); diff --git a/wp-admin/upgrade.php b/wp-admin/upgrade.php index 5fe6f4419..c6c087d89 100644 --- a/wp-admin/upgrade.php +++ b/wp-admin/upgrade.php @@ -20,10 +20,19 @@ require('../wp-load.php'); timer_start(); require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); -if (isset($_GET['step'])) - $step = (int) $_GET['step']; +if ( isset($_GET['step']) ) + $step = $_GET['step']; else $step = 0; + +// Do it. No output. +if ( 'upgrade_db' === $step ) { + wp_upgrade(); + die('0'); +} + +$step = (int) $step; + @header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset')); ?>