Core support for partial updates. see #10611.
git-svn-id: http://svn.automattic.com/wordpress/trunk@18225 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -885,7 +885,21 @@ class Core_Upgrader extends WP_Upgrader {
|
||||
|
||||
$wp_dir = trailingslashit($wp_filesystem->abspath());
|
||||
|
||||
$download = $this->download_package( $current->package );
|
||||
// If partial update is returned from the API, use that, unless we're doing a reinstall.
|
||||
// If we cross the new_bundled version number, then use the new_bundled zip.
|
||||
// Don't though if the constant is set to skip bundled items.
|
||||
// If the API returns a no_content zip, go with it. Finally, default to the full zip.
|
||||
if ( $current->packages->partial && 'reinstall' != $current->response )
|
||||
$to_download = 'partial';
|
||||
elseif ( $current->packages->new_bundled && version_compare( $wp_version, $current->new_bundled, '<' )
|
||||
&& ( ! defined( 'CORE_UPGRADE_SKIP_NEW_BUNDLED' ) || ! CORE_UPGRADE_SKIP_NEW_BUNDLED ) )
|
||||
$to_download = 'new_bundled';
|
||||
elseif ( $current->packages->no_content )
|
||||
$to_download = 'no_content';
|
||||
else
|
||||
$to_download = 'full';
|
||||
|
||||
$download = $this->download_package( $current->packages->$to_download );
|
||||
if ( is_wp_error($download) )
|
||||
return $download;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user