WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/09/2021 03:37:41 AM (4 months ago)
Author:
SergeyBiryukov
Message:

Upgrade/Install: Introduce a move_dir() function.

This replaces the copy_dir() usage in WP_Upgrader::install_package() and aims to avoid PHP timeout issues when installing or updating large plugins on slower systems like Vagrant or the WP Docker test environment.

The new function attempts a native PHP rename() function first and falls back to the previous copy_dir().

Follow-up to [51815], [51898].

Props afragen, aristath, peterwilsoncc, galbaras, noisysocks, pbiron.
Fixes #54166. See #51857.

File:
1 edited

Legend:

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

    r51854 r51899  
    624624        }
    625625
    626         // Copy new version of item into place.
    627         $result = copy_dir( $source, $remote_destination );
     626        // Move new version of item into place.
     627        $result = move_dir( $source, $remote_destination );
    628628        if ( is_wp_error( $result ) ) {
    629629            if ( $args['clear_working'] ) {
Note: See TracChangeset for help on using the changeset viewer.