Make WordPress Core

Changeset 55205


Ignore:
Timestamp:
02/03/2023 01:57:31 AM (3 years ago)
Author:
azaozz
Message:

Docs: Document directory support in FTP/SSH2 filesystem ::move() methods.

Props: costdev, flixos90, audrasjb.
Fixes: #57604.

Location:
trunk/src/wp-admin/includes
Files:
3 edited

Legend:

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

    r54815 r55205  
    359359
    360360    /**
    361      * Moves a file.
    362      *
    363      * @since 2.5.0
    364      *
    365      * @param string $source      Path to the source file.
    366      * @param string $destination Path to the destination file.
    367      * @param bool   $overwrite   Optional. Whether to overwrite the destination file if it exists.
     361     * Moves a file or directory.
     362     *
     363     * After moving files or directories, OPcache will need to be invalidated.
     364     *
     365     * If moving a directory fails, `copy_dir()` can be used for a recursive copy.
     366     *
     367     * Use `move_dir()` for moving directories with OPcache invalidation and a
     368     * fallback to `copy_dir()`.
     369     *
     370     * @since 2.5.0
     371     *
     372     * @param string $source      Path to the source file or directory.
     373     * @param string $destination Path to the destination file or directory.
     374     * @param bool   $overwrite   Optional. Whether to overwrite the destination if it exists.
    368375     *                            Default false.
    369376     * @return bool True on success, false on failure.
  • trunk/src/wp-admin/includes/class-wp-filesystem-ftpsockets.php

    r54815 r55205  
    369369
    370370    /**
    371      * Moves a file.
    372      *
    373      * @since 2.5.0
    374      *
    375      * @param string $source      Path to the source file.
    376      * @param string $destination Path to the destination file.
    377      * @param bool   $overwrite   Optional. Whether to overwrite the destination file if it exists.
     371     * Moves a file or directory.
     372     *
     373     * After moving files or directories, OPcache will need to be invalidated.
     374     *
     375     * If moving a directory fails, `copy_dir()` can be used for a recursive copy.
     376     *
     377     * Use `move_dir()` for moving directories with OPcache invalidation and a
     378     * fallback to `copy_dir()`.
     379     *
     380     * @since 2.5.0
     381     *
     382     * @param string $source      Path to the source file or directory.
     383     * @param string $destination Path to the destination file or directory.
     384     * @param bool   $overwrite   Optional. Whether to overwrite the destination if it exists.
    378385     *                            Default false.
    379386     * @return bool True on success, false on failure.
  • trunk/src/wp-admin/includes/class-wp-filesystem-ssh2.php

    r53872 r55205  
    497497
    498498    /**
    499      * Moves a file.
    500      *
    501      * @since 2.7.0
    502      *
    503      * @param string $source      Path to the source file.
    504      * @param string $destination Path to the destination file.
    505      * @param bool   $overwrite   Optional. Whether to overwrite the destination file if it exists.
     499     * Moves a file or directory.
     500     *
     501     * After moving files or directories, OPcache will need to be invalidated.
     502     *
     503     * If moving a directory fails, `copy_dir()` can be used for a recursive copy.
     504     *
     505     * Use `move_dir()` for moving directories with OPcache invalidation and a
     506     * fallback to `copy_dir()`.
     507     *
     508     * @since 2.7.0
     509     *
     510     * @param string $source      Path to the source file or directory.
     511     * @param string $destination Path to the destination file or directory.
     512     * @param bool   $overwrite   Optional. Whether to overwrite the destination if it exists.
    506513     *                            Default false.
    507514     * @return bool True on success, false on failure.
     
    510517        if ( $this->exists( $destination ) ) {
    511518            if ( $overwrite ) {
    512                 // We need to remove the destination file before we can rename the source.
     519                // We need to remove the destination before we can rename the source.
    513520                $this->delete( $destination, false, 'f' );
    514521            } else {
Note: See TracChangeset for help on using the changeset viewer.