Changeset 55220
- Timestamp:
- 02/04/2023 03:29:43 AM (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-upgrader.php
r55055 r55220 430 430 * 431 431 * @since 2.8.0 432 * @since 6.2.0 Use move_dir() instead of copy_dir() when possible. 432 433 * 433 434 * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass. … … 587 588 } 588 589 589 // Create destination if needed. 590 if ( ! $wp_filesystem->exists( $remote_destination ) ) { 591 if ( ! $wp_filesystem->mkdir( $remote_destination, FS_CHMOD_DIR ) ) { 592 return new WP_Error( 'mkdir_failed_destination', $this->strings['mkdir_failed'], $remote_destination ); 593 } 594 } 595 596 // Copy new version of item into place. 597 $result = copy_dir( $source, $remote_destination ); 590 /* 591 * Partial updates may want to retain the destination. 592 * move_dir() returns a WP_Error when the destination exists, 593 * so copy_dir() should be used. 594 * 595 * If 'clear_working' is false, the source shouldn't be removed. 596 * After move_dir() runs, the source will no longer exist. 597 * Therefore, copy_dir() should be used. 598 */ 599 if ( $clear_destination && $args['clear_working'] ) { 600 $result = move_dir( $source, $remote_destination, true ); 601 } else { 602 // Create destination if needed. 603 if ( ! $wp_filesystem->exists( $remote_destination ) ) { 604 if ( ! $wp_filesystem->mkdir( $remote_destination, FS_CHMOD_DIR ) ) { 605 return new WP_Error( 'mkdir_failed_destination', $this->strings['mkdir_failed'], $remote_destination ); 606 } 607 } 608 $result = copy_dir( $source, $remote_destination ); 609 } 598 610 599 611 // Clear the working folder?
Note: See TracChangeset
for help on using the changeset viewer.