diff --git a/core/modules/migrate/src/Plugin/migrate/process/Download.php b/core/modules/migrate/src/Plugin/migrate/process/Download.php index 2014085e042d47b448d5ab3bd664dc57bd77ddb4..cfcba8115b933225294b9216ecb6988eec7627c4 100644 --- a/core/modules/migrate/src/Plugin/migrate/process/Download.php +++ b/core/modules/migrate/src/Plugin/migrate/process/Download.php @@ -12,7 +12,42 @@ use Symfony\Component\DependencyInjection\ContainerInterface; /** - * Downloads a file from a remote location into the local file system. + * Downloads a file from a HTTP(S) remote location into the local file system. + * + * The source value is an array of two values: + * - source URL, e.g. 'http://www.example.com/img/foo.img' + * - destination URI, e.g. 'public://images/foo.img' + * + * Available configuration keys: + * - rename: (optional) If set, a unique destination URI is generated. If not + * set, the destination URI will be overwritten if it exists. + * - guzzle_options: (optional) + * @link http://docs.guzzlephp.org/en/latest/request-options.html Array of request options for Guzzle. @endlink + * + * Examples: + * + * @code + * process: + * plugin: download + * source: + * - source_url + * - destination_uri + * @endcode + * + * This will download source_url to destination_uri. + * + * @code + * process: + * plugin: download + * source: + * - source_url + * - destination_uri + * rename: true + * @endcode + * + * This will download source_url to destination_uri and ensure that the + * destination URI is unique. If a file with the same name exists at the + * destination, a numbered suffix like '_0' will be appended to make it unique. * * @MigrateProcessPlugin( * id = "download"