Projet

Général

Profil

Révision 4444412d

Ajouté par Julien Enselme il y a presque 10 ans

Update drupal 7.27 -> 7.28

Voir les différences:

drupal7/modules/system/system.module
3422 3422
/**
3423 3423
 * Attempts to get a file using drupal_http_request and to store it locally.
3424 3424
 *
3425
 * @param $url
3425
 * @param string $url
3426 3426
 *   The URL of the file to grab.
3427
 *
3428
 * @param $destination
3427
 * @param string $destination
3429 3428
 *   Stream wrapper URI specifying where the file should be placed. If a
3430 3429
 *   directory path is provided, the file is saved into that directory under
3431 3430
 *   its original name. If the path contains a filename as well, that one will
3432 3431
 *   be used instead.
3433 3432
 *   If this value is omitted, the site's default files scheme will be used,
3434 3433
 *   usually "public://".
3435
 *
3436
 * @param $managed boolean
3434
 * @param bool $managed
3437 3435
 *   If this is set to TRUE, the file API hooks will be invoked and the file is
3438 3436
 *   registered in the database.
3439
 *
3440
 * @param $replace boolean
3437
 * @param int $replace
3441 3438
 *   Replace behavior when the destination file already exists:
3442 3439
 *   - FILE_EXISTS_REPLACE: Replace the existing file.
3443 3440
 *   - FILE_EXISTS_RENAME: Append _{incrementing number} until the filename is
3444 3441
 *     unique.
3445 3442
 *   - FILE_EXISTS_ERROR: Do nothing and return FALSE.
3446 3443
 *
3447
 * @return
3448
 *   On success the location the file was saved to, FALSE on failure.
3444
 * @return mixed
3445
 *   One of these possibilities:
3446
 *   - If it succeeds and $managed is FALSE, the location where the file was
3447
 *     saved.
3448
 *   - If it succeeds and $managed is TRUE, a \Drupal\file\FileInterface
3449
 *     object which describes the file.
3450
 *   - If it fails, FALSE.
3449 3451
 */
3450 3452
function system_retrieve_file($url, $destination = NULL, $managed = FALSE, $replace = FILE_EXISTS_RENAME) {
3451 3453
  $parsed_url = parse_url($url);

Formats disponibles : Unified diff