mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Upgrade/install: Revert upgrader rollback features.
Revert the rollback features introduced for theme and plugin upgrades during the WordPress 5.9 cycle. A bug (suspected to be in third party virtualisation software) causes the upgrades to fail consistently on some set ups. The revert is to allow contributors further time to investigate mitigation options. Reverts [52337], [52289], [52284], [51951], [52192], [51902], [51899], [51898], [51815]. Props pbiron, dlh, peterwilsoncc, galbaras, SergeyBiryukov, afragen, costdev, bronsonquick, aristath, noisysocks, desrosj, TobiasBg, hellofromTonya, francina, Boniu91. See #54543, #54166, #51857. git-svn-id: https://develop.svn.wordpress.org/trunk@52351 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1943,53 +1943,6 @@ function copy_dir( $from, $to, $skip_list = array() ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Moves a directory from one location to another via the rename() PHP function.
|
||||
* If the renaming failed, falls back to copy_dir().
|
||||
*
|
||||
* Assumes that WP_Filesystem() has already been called and setup.
|
||||
*
|
||||
* @since 5.9.0
|
||||
*
|
||||
* @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
|
||||
*
|
||||
* @param string $from Source directory.
|
||||
* @param string $to Destination directory.
|
||||
* @param string $working_dir Optional. Remote file source directory.
|
||||
* Default empty string.
|
||||
* @return true|WP_Error True on success, WP_Error on failure.
|
||||
*/
|
||||
function move_dir( $from, $to, $working_dir = '' ) {
|
||||
global $wp_filesystem;
|
||||
|
||||
if ( 'direct' === $wp_filesystem->method ) {
|
||||
$wp_filesystem->rmdir( $to );
|
||||
if ( @rename( $from, $to ) ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! $wp_filesystem->is_dir( $to ) ) {
|
||||
if ( ! $wp_filesystem->mkdir( $to, FS_CHMOD_DIR ) ) {
|
||||
|
||||
// Clear the working directory?
|
||||
if ( ! empty( $working_dir ) ) {
|
||||
$wp_filesystem->delete( $working_dir, true );
|
||||
}
|
||||
|
||||
return new WP_Error( 'mkdir_failed_move_dir', __( 'Could not create directory.' ), $to );
|
||||
}
|
||||
}
|
||||
$result = copy_dir( $from, $to );
|
||||
|
||||
// Clear the working directory?
|
||||
if ( ! empty( $working_dir ) ) {
|
||||
$wp_filesystem->delete( $working_dir, true );
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes and connects the WordPress Filesystem Abstraction classes.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user