diff --git a/core/modules/migrate/src/Plugin/migrate/process/FileCopy.php b/core/modules/migrate/src/Plugin/migrate/process/FileCopy.php index 9aa59006bafa1329a1c27d76e8c2e0fc284756aa..58aa463500ed58f2b2129611f3927977132ea761 100644 --- a/core/modules/migrate/src/Plugin/migrate/process/FileCopy.php +++ b/core/modules/migrate/src/Plugin/migrate/process/FileCopy.php @@ -14,7 +14,36 @@ use Symfony\Component\DependencyInjection\ContainerInterface; /** - * Copy a file from one place into another. + * Copies or moves a local file from one place into another. + * + * The file can be moved, reused, or set to be automatically renamed if a + * duplicate exists. + * + * The source value is an array of two values: + * - source: The source path or URI, e.g. '/path/to/foo.txt' or + * 'public://bar.txt'. + * - destination: The destination path or URI, e.g. '/path/to/bar.txt' or + * 'public://foo.txt'. + * + * Available configuration keys: + * - move: (optional) Boolean, if TRUE, move the file, otherwise copy the file. + * Defaults to FALSE. + * - rename: (optional) Boolean, if TRUE, rename the file by appending a number + * until the name is unique. Defaults to FALSE. + * - reuse: (optional) Boolean, if TRUE, reuse the current file in its existing + * location rather than move/copy/rename the file. Defaults to FALSE. + * + * Examples: + * + * @code + * process: + * path_to_file: + * plugin: file_copy + * source: /path/to/file.png + * destination: /new/path/to/file.png + * @endcode + * + * @see \Drupal\migrate\Plugin\MigrateProcessInterface * * @MigrateProcessPlugin( * id = "file_copy"