Changeset 51899
- Timestamp:
- 10/09/2021 03:37:41 AM (3 years ago)
- Location:
- trunk/src/wp-admin/includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-upgrader.php
r51854 r51899 624 624 } 625 625 626 // Copynew 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 ); 628 628 if ( is_wp_error( $result ) ) { 629 629 if ( $args['clear_working'] ) { -
trunk/src/wp-admin/includes/file.php
r51626 r51899 1919 1919 1920 1920 /** 1921 * Moves a directory from one location to another via the rename() PHP function. 1922 * If the renaming failed, falls back to copy_dir(). 1923 * 1924 * Assumes that WP_Filesystem() has already been called and setup. 1925 * 1926 * @since 5.9.0 1927 * 1928 * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass. 1929 * 1930 * @param string $from Source directory. 1931 * @param string $to Destination directory. 1932 * @return true|WP_Error True on success, WP_Error on failure. 1933 */ 1934 function move_dir( $from, $to ) { 1935 global $wp_filesystem; 1936 1937 $wp_filesystem->rmdir( $to ); 1938 if ( @rename( $from, $to ) ) { 1939 return true; 1940 } 1941 1942 $wp_filesystem->mkdir( $to ); 1943 $result = copy_dir( $from, $to ); 1944 1945 return $result; 1946 } 1947 1948 /** 1921 1949 * Initializes and connects the WordPress Filesystem Abstraction classes. 1922 1950 *
Note: See TracChangeset
for help on using the changeset viewer.