summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxjm2017-02-22 17:57:43 (GMT)
committerxjm2017-02-22 17:57:43 (GMT)
commit818c3fa7f80ae2e4626f610ea467f78478d46364 (patch)
treea5f455727ed9de160a4c55b5b24b99d4abd5284c
parent90bdd031cbaa8dbc0db18fd5fb458bac4723a502 (diff)
Issue #2831630 by quietone, Jo Fitzgerald, Kifah Meeran, phenaproxima, gaurav.kapoor, mikeryan, heddn, xjm, claudiu.cristea: Add documentation to download process plugin
-rw-r--r--core/modules/migrate/src/Plugin/migrate/process/Download.php37
1 files changed, 36 insertions, 1 deletions
diff --git a/core/modules/migrate/src/Plugin/migrate/process/Download.php b/core/modules/migrate/src/Plugin/migrate/process/Download.php
index 2014085..cfcba81 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 GuzzleHttp\Client;
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"