function backup_migrate_get_destinations

nittany7 destinations.inc backup_migrate_get_destinations($op = 'all')
mooc7 destinations.inc backup_migrate_get_destinations($op = 'all')

Get all the available backup destination.

Parameters

$op: The operation which will be performed on the destination. Hooks can use this to return only those destinations appropriate for the given op. Options include: 'manual backup' - destinations available for manual backup 'scheduled backup' - destinations available for schedules backup 'list files' - destinations whose backup files can be listed 'restore' - destinations whose files can be restored from 'all' - all available destinations should be returned

5 calls to backup_migrate_get_destinations()
backup_migrate_filter_backup_restore::backup_settings_default in modules/contrib/backup_migrate/includes/filters.backup_restore.inc
Get the default backup settings for this filter.
backup_migrate_filter_backup_restore::backup_settings_form in modules/contrib/backup_migrate/includes/filters.backup_restore.inc
Get the form for the backup settings for this filter.
backup_migrate_get_destination in modules/contrib/backup_migrate/includes/destinations.inc
Get the destination of the given id.
_backup_migrate_drush_destinations in modules/contrib/backup_migrate/includes/backup_migrate.drush.inc
Get a list of available destinations with the given op.
_backup_migrate_get_destination_form_item_options in modules/contrib/backup_migrate/includes/destinations.inc
Get the destination options as an options array for a form item.

File

modules/contrib/backup_migrate/includes/destinations.inc, line 183
All of the destination handling code needed for Backup and Migrate.

Code

function backup_migrate_get_destinations($op = 'all') {
  static $destinations = NULL;

  // Get the list of destinations and cache them locally.
  if ($destinations === NULL) {
    $destinations = backup_migrate_crud_get_items('destination');
  }

  // Return all if that's what was asked for.
  if ($op == 'all') {
    return $destinations;
  }

  // Return only those destinations which support the given op.
  $out = array();
  foreach ($destinations as $key => $destination) {
    if ($destination->op($op)) {
      $out[$key] = $destination;
    }
  }
  return $out;
}