You are here

function backup_migrate_destination_save_file in Backup and Migrate 8.3

Same name and namespace in other branches
  1. 8.2 includes/destinations.inc \backup_migrate_destination_save_file()
  2. 5.2 includes/destinations.inc \backup_migrate_destination_save_file()
  3. 6.3 includes/destinations.inc \backup_migrate_destination_save_file()
  4. 6.2 includes/destinations.inc \backup_migrate_destination_save_file()
  5. 7.3 includes/destinations.inc \backup_migrate_destination_save_file()
  6. 7.2 includes/destinations.inc \backup_migrate_destination_save_file()

Send a file to the destination specified by the settings array.

1 call to backup_migrate_destination_save_file()
backup_migrate_perform_backup in ./backup_migrate.module
Perform a backup with the given settings.

File

includes/destinations.inc, line 237

Code

function backup_migrate_destination_save_file($file, &$settings) {
  $saved_to = array();
  if ($destinations = $settings
    ->get_destinations()) {
    foreach ($destinations as $destination) {

      // Make sure the file only gets saved to each destination once.
      $id = $destination
        ->get('id');
      if (!in_array($id, $saved_to)) {
        if ($destination
          ->save_file($file, $settings)) {
          $saved_to[] = $id;
        }
      }
    }
  }
  return $saved_to ? $file : FALSE;
}