You are here

function backup_migrate_backup_migrate_destinations in Backup and Migrate 7.3

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

Implements hook_backup_migrate_destinations().

File

includes/destinations.inc, line 87

Code

function backup_migrate_backup_migrate_destinations() {
  require_once dirname(__FILE__) . '/filters.inc';

  // Get the built in backup destinations and those in the db.
  $out = array();

  // Add the default, out of the box destinations for new users.
  if (variable_get('backup_migrate_allow_backup_to_file', TRUE)) {
    if (variable_get('file_private_path', FALSE)) {
      $out['manual'] = backup_migrate_create_destination('file_manual', array(
        'machine_name' => 'manual',
      ));
      $out['scheduled'] = backup_migrate_create_destination('file_scheduled', array(
        'machine_name' => 'scheduled',
      ));
    }
    else {
      _backup_migrate_message('You must specify a private file system path in the !settings to backup to the server.', array(
        '!settings' => l(t('file system settings'), 'admin/config/media/file-system'),
      ), 'warning');
    }
  }

  // Add the browser destination for downloading to the desktop.
  if (variable_get('backup_migrate_allow_backup_to_download', TRUE)) {
    $out['download'] = backup_migrate_create_destination('browser_download');
  }
  $out['upload'] = backup_migrate_create_destination('browser_upload');

  // Expose the configured databases as sources.
  $out += backup_migrate_filters_invoke_all('destinations');
  return $out;
}