Make WordPress Core


Ignore:
Timestamp:
06/10/2011 05:47:44 AM (14 years ago)
Author:
nacin
Message:

Core support for partial updates. see #10611.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/class-wp-upgrader.php

    r18084 r18225  
    886886        $wp_dir = trailingslashit($wp_filesystem->abspath());
    887887
    888         $download = $this->download_package( $current->package );
     888        // If partial update is returned from the API, use that, unless we're doing a reinstall.
     889        // If we cross the new_bundled version number, then use the new_bundled zip.
     890        // Don't though if the constant is set to skip bundled items.
     891        // If the API returns a no_content zip, go with it. Finally, default to the full zip.
     892        if ( $current->packages->partial && 'reinstall' != $current->response )
     893            $to_download = 'partial';
     894        elseif ( $current->packages->new_bundled && version_compare( $wp_version, $current->new_bundled, '<' )
     895            && ( ! defined( 'CORE_UPGRADE_SKIP_NEW_BUNDLED' ) || ! CORE_UPGRADE_SKIP_NEW_BUNDLED ) )
     896            $to_download = 'new_bundled';
     897        elseif ( $current->packages->no_content )
     898            $to_download = 'no_content';
     899        else
     900            $to_download = 'full';
     901
     902        $download = $this->download_package( $current->packages->$to_download );
    889903        if ( is_wp_error($download) )
    890904            return $download;
Note: See TracChangeset for help on using the changeset viewer.