You are here

function backup_migrate_destination_get_file in Backup and Migrate 5.2

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

Load a file from a destination and return the file info.

4 calls to backup_migrate_destination_get_file()
backup_migrate_perform_restore in ./backup_migrate.module
Restore from a file in the given destination.
backup_migrate_ui_destination_delete_file in includes/destinations.inc
Menu callback to delete a file from a destination.
backup_migrate_ui_destination_download_file in includes/destinations.inc
Download a file to the browser.
backup_migrate_ui_destination_restore_file in includes/destinations.inc
Restore a backup file from a destination.

File

includes/destinations.inc, line 217
All of the destination handling code needed for Backup and Migrate.

Code

function backup_migrate_destination_get_file($destination_id, $file_id) {
  if ($destination = backup_migrate_get_destination($destination_id)) {

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

    // Call the specified load callback.
    if (!empty($destination['load_callback'])) {
      return $destination['load_callback']($destination, $file_id);
    }
  }
  return NULL;
}