return $working_dir;
} // Copy update-core.php from the new version into place.
if ( !
$wp_filesystem->
copy( $working_dir . '/wordpress/wp-admin/includes/update-core.php',
$wp_dir . 'wp-admin/includes/update-core.php', true
) ) { $wp_filesystem->
delete( $working_dir, true
);
WP_Upgrader::
release_lock( 'core_updater'
);
return new WP_Error( 'copy_failed_for_update_core_file',
__( 'The update cannot be installed because some files could not be copied. This is usually due to inconsistent file permissions.'
), 'wp-admin/includes/update-core.php'
);
} $wp_filesystem->
chmod( $wp_dir . 'wp-admin/includes/update-core.php', FS_CHMOD_FILE
);
wp_opcache_invalidate( ABSPATH . 'wp-admin/includes/update-core.php'
);
require_once ABSPATH . 'wp-admin/includes/update-core.php';
if ( !
function_exists( 'update_core'
) ) { WP_Upgrader::
release_lock( 'core_updater'
);
return new WP_Error( 'copy_failed_space',
$this->strings
['copy_failed_space'
] );
} $result =
update_core( $working_dir,
$wp_dir );
// In the event of an issue, we may be able to roll back.
if ( $parsed_args['attempt_rollback'
] &&
$current->packages->rollback && !
$parsed_args['do_rollback'
] ) {