// Create maintenance file to signal that we are upgrading.
$maintenance_string = '<?php $upgrading = ' .
time() . '; ?>';
$maintenance_file =
$to . '.maintenance';
$wp_filesystem->
delete( $maintenance_file );
$wp_filesystem->
put_contents( $maintenance_file,
$maintenance_string, FS_CHMOD_FILE
);
/** This filter is documented in wp-admin/includes/update-core.php */
apply_filters( 'update_feedback',
__( 'Copying the required files…'
) );
// Copy new versions of WP files into place.
$result =
copy_dir( $from .
$distro,
$to,
$skip );
if ( is_wp_error( $result ) ) { $result =
new WP_Error( $result->
get_error_code(),
$result->
get_error_message(),
substr( $result->
get_error_data(),
strlen( $to ) ) );
} // Since we know the core files have copied over, we can now copy the version file.
if ( !
is_wp_error( $result ) ) {