Issue #2174353 by anemes, bryanlburkholder: Fix up docs for system_retrieve_file

8.0.x
Jennifer Hodgdon 2014-02-12 16:19:44 -08:00
parent 5f9a7b1901
commit faa467537b
1 changed files with 11 additions and 9 deletions

View File

@ -3026,30 +3026,32 @@ function theme_system_compact_link() {
/**
* Attempts to get a file using Guzzle HTTP client and to store it locally.
*
* @param $url
* @param string $url
* The URL of the file to grab.
*
* @param $destination
* @param string $destination
* Stream wrapper URI specifying where the file should be placed. If a
* directory path is provided, the file is saved into that directory under
* its original name. If the path contains a filename as well, that one will
* be used instead.
* If this value is omitted, the site's default files scheme will be used,
* usually "public://".
*
* @param $managed boolean
* @param bool $managed
* If this is set to TRUE, the file API hooks will be invoked and the file is
* registered in the database.
*
* @param $replace boolean
* @param int $replace
* Replace behavior when the destination file already exists:
* - FILE_EXISTS_REPLACE: Replace the existing file.
* - FILE_EXISTS_RENAME: Append _{incrementing number} until the filename is
* unique.
* - FILE_EXISTS_ERROR: Do nothing and return FALSE.
*
* @return
* On success the location the file was saved to, FALSE on failure.
* @return mixed
* One of these possibilities:
* - If it succeeds and $managed is FALSE, the location where the file was
* saved.
* - If it succeeds and $managed is TRUE, a \Drupal\file\FileInterface
* object which describes the file.
* - If it fails, FALSE.
*/
function system_retrieve_file($url, $destination = NULL, $managed = FALSE, $replace = FILE_EXISTS_RENAME) {
$parsed_url = parse_url($url);