You are here

function backup_migrate_destination_save_file in Backup and Migrate 5.2

Same name and namespace in other branches
  1. 8.2 includes/destinations.inc \backup_migrate_destination_save_file()
  2. 8.3 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 235
All of the destination handling code needed for Backup and Migrate.

Code

function backup_migrate_destination_save_file($file, &$settings) {
  if ($destination = backup_migrate_get_destination($settings['destination_id'])) {
    $settings['destination'] = $destination;

    // Include the necessary file if specified by the download type.
    if (!empty($destination['file'])) {
      require_once './' . $destination['file'];
    }

    // Call the specified download callback.
    if (!empty($destination['save_callback'])) {
      $settings['file_id'] = $settings['filename'];
      $file = $destination['save_callback']($destination, $file, $settings);
      return $file;
    }
  }
  return NULL;
}