Ticket #25998: wp-admin_includes_update-core-php.diff
File wp-admin_includes_update-core-php.diff, 3.8 KB (added by , 11 years ago) |
---|
-
wp-admin/includes/update-core.php
644 644 @set_time_limit( 300 ); 645 645 646 646 // Sanity check the unzipped distribution 647 /** 648 * Filter the real time feedback of update core processes. 649 * 650 * @since 2.5.0 651 * 652 * @param string $feedback The real time feedback of update core processes. 653 */ 647 654 apply_filters( 'update_feedback', __('Verifying the unpacked files…') ); 648 655 $distro = ''; 649 656 $roots = array( '/wordpress/', '/wordpress-mu/' ); … … 689 696 return new WP_Error( 'php_not_compatible', sprintf( __('The update cannot be installed because WordPress %1$s requires PHP version %2$s or higher. You are running version %3$s.'), $wp_version, $required_php_version, $php_version ) ); 690 697 elseif ( !$mysql_compat ) 691 698 return new WP_Error( 'mysql_not_compatible', sprintf( __('The update cannot be installed because WordPress %1$s requires MySQL version %2$s or higher. You are running version %3$s.'), $wp_version, $required_mysql_version, $mysql_version ) ); 692 699 700 /** This filter is documented in wp-admin/includes/update-core.php */ 693 701 apply_filters( 'update_feedback', __( 'Preparing to install the latest version…' ) ); 694 702 695 703 // Don't copy wp-content, we'll deal with that below … … 739 747 return new WP_Error( 'files_not_writable', __( 'The update cannot be installed because we will be unable to copy some files. This is usually due to inconsistent file permissions.' ), implode( ', ', $error_data ) ); 740 748 } 741 749 } 742 750 751 /** This filter is documented in wp-admin/includes/update-core.php */ 743 752 apply_filters( 'update_feedback', __( 'Enabling Maintenance mode…' ) ); 744 753 // Create maintenance file to signal that we are upgrading 745 754 $maintenance_string = '<?php $upgrading = ' . time() . '; ?>'; 746 755 $maintenance_file = $to . '.maintenance'; 747 756 $wp_filesystem->delete($maintenance_file); 748 757 $wp_filesystem->put_contents($maintenance_file, $maintenance_string, FS_CHMOD_FILE); 749 758 759 /** This filter is documented in wp-admin/includes/update-core.php */ 750 760 apply_filters( 'update_feedback', __( 'Copying the required files…' ) ); 751 761 // Copy new versions of WP files into place. 752 762 $result = _copy_dir( $from . $distro, $to, $skip ); … … 811 821 } 812 822 } 813 823 } 814 824 825 /** This filter is documented in wp-admin/includes/update-core.php */ 815 826 apply_filters( 'update_feedback', __( 'Disabling Maintenance mode…' ) ); 816 827 // Remove maintenance file, we're done with potential site-breaking changes 817 828 $wp_filesystem->delete( $maintenance_file ); … … 883 894 } 884 895 885 896 // Upgrade DB with separate request 897 /** This filter is documented in wp-admin/includes/update-core.php */ 886 898 apply_filters('update_feedback', __('Upgrading database…')); 887 899 $db_upgrade_url = admin_url('upgrade.php?step=upgrade_db'); 888 900 wp_remote_post($db_upgrade_url, array('timeout' => 60)); … … 897 909 delete_option('update_core'); 898 910 899 911 // If we made it this far: 912 /** 913 * Fires once the WordPress core is updated successfully. 914 * 915 * @since 3.3.0 916 * 917 * @param string $wp_version The current WordPress version. 918 */ 900 919 do_action( '_core_updated_successfully', $wp_version ); 901 920 902 921 // Clear the option that blocks auto updates after failures, now that we've been successful. … … 1004 1023 include(ABSPATH . 'wp-admin/admin-footer.php'); 1005 1024 exit(); 1006 1025 } 1007 add_action( '_core_updated_successfully', '_redirect_to_about_wordpress' ); 1026 add_action( '_core_updated_successfully', '_redirect_to_about_wordpress' ); 1027 No newline at end of file