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
This commit is contained in:
parent
bcdb29372d
commit
42ceb32c0b
|
@ -199,13 +199,8 @@ function update_core($from, $to) {
|
||||||
|
|
||||||
// Might have to do upgrade in a separate step.
|
// Might have to do upgrade in a separate step.
|
||||||
apply_filters('update_feedback', __('Upgrading database'));
|
apply_filters('update_feedback', __('Upgrading database'));
|
||||||
// Get new db version
|
$db_upgrade_url = admin_url('upgrade.php?step=upgrade_db');
|
||||||
global $wp_db_version;
|
wp_remote_post($db_upgrade_url, array('timeout' => 60));
|
||||||
require (ABSPATH . WPINC . '/version.php');
|
|
||||||
// Upgrade db
|
|
||||||
define('WP_INSTALLING', true);
|
|
||||||
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
|
|
||||||
wp_upgrade();
|
|
||||||
|
|
||||||
// Remove working directory
|
// Remove working directory
|
||||||
$wp_filesystem->delete($from, true);
|
$wp_filesystem->delete($from, true);
|
||||||
|
|
|
@ -20,10 +20,19 @@ require('../wp-load.php');
|
||||||
timer_start();
|
timer_start();
|
||||||
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
|
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
|
||||||
|
|
||||||
if (isset($_GET['step']))
|
if ( isset($_GET['step']) )
|
||||||
$step = (int) $_GET['step'];
|
$step = $_GET['step'];
|
||||||
else
|
else
|
||||||
$step = 0;
|
$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'));
|
@header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
|
Loading…
Reference in New Issue