mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-22 07:22:01 +01:00
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: http://svn.automattic.com/wordpress/trunk@9085 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
3f5753f4b1
commit
c209f15b5c
@ -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);
|
||||
}
|
||||
|
||||
?>
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user