Don't die with 503 if WP_INSTALLING. Don't load plugins if WP_INSTALLING. Remove old files and working dir before exiting maintenance mode. see #5560

git-svn-id: https://develop.svn.wordpress.org/trunk@9085 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2008-10-05 05:45:34 +00:00
parent 9c3fd20686
commit 9da6ee40f4
2 changed files with 9 additions and 9 deletions

View File

@ -199,17 +199,11 @@ function update_core($from, $to) {
return $result;
}
// Might have to do upgrade in a separate step.
// Upgrade DB with separate request
apply_filters('update_feedback', __('Upgrading database'));
$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);
// Remove maintenance file, we're done.
$wp_filesystem->delete($maintenance_file);
// Remove old files
foreach ( $_old_files as $old_file ) {
$old_file = $to . $old_file;
@ -218,8 +212,14 @@ function update_core($from, $to) {
$wp_filesystem->delete($old_file, true);
}
// Remove working directory
$wp_filesystem->delete($from, true);
// Force refresh of update information
delete_option('update_core');
// Remove maintenance file, we're done.
$wp_filesystem->delete($maintenance_file);
}
?>

View File

@ -107,7 +107,7 @@ if ( version_compare( '4.3', phpversion(), '>' ) ) {
if ( !defined('WP_CONTENT_DIR') )
define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' ); // no trailing slash, full paths only - WP_CONTENT_URL is defined further down
if ( file_exists(ABSPATH . '.maintenance') ) {
if ( file_exists(ABSPATH . '.maintenance') && !defined('WP_INSTALLING') ) {
if ( file_exists( WP_CONTENT_DIR . '/maintenance.php' ) ) {
require_once( WP_CONTENT_DIR . '/maintenance.php' );
die();
@ -445,7 +445,7 @@ if (get_option('hack_file')) {
require(ABSPATH . 'my-hacks.php');
}
if ( get_option('active_plugins') ) {
if ( get_option('active_plugins') && !defined('WP_INSTALLING') ) {
$current_plugins = get_option('active_plugins');
if ( is_array($current_plugins) ) {
foreach ($current_plugins as $plugin) {