You are here

function _backup_migrate_setup_databaase_defaults in Backup and Migrate 5.2

2 calls to _backup_migrate_setup_databaase_defaults()
backup_migrate_install in ./backup_migrate.install
backup_migrate_update_2000 in ./backup_migrate.install
Update from 1.x to 2.x.

File

./backup_migrate.install, line 62
Install hooks for Backup and Migrate.

Code

function _backup_migrate_setup_databaase_defaults() {
  require_once './' . drupal_get_path('module', 'backup_migrate') . '/includes/profiles.inc';
  require_once './' . drupal_get_path('module', 'backup_migrate') . '/includes/db.inc';
  require_once './' . drupal_get_path('module', 'backup_migrate') . '/includes/files.inc';

  // Set up the default schedules.
  if (variable_get("backup_migrate_schedule_backup_period", 0) !== 0) {
    require_once './' . drupal_get_path('module', 'backup_migrate') . '/includes/schedules.inc';
    $schedule = array(
      'name' => t('Default Schedule'),
      'destination_id' => 'schedule,',
      'period' => variable_get("backup_migrate_schedule_backup_period", 0),
      'keep' => variable_get("backup_migrate_schedule_backup_keep", 0),
    );
    backup_migrate_schedule_save_schedule($schedule);
  }
  if (variable_get("backup_migrate_file_name", NULL)) {
    $settings = array(
      'source_id' => 'db_url:default',
      'exclude_tables' => variable_get("backup_migrate_exclude_tables", _backup_migrate_default_exclude_tables()),
      'nodata_tables' => variable_get("backup_migrate_nodata_tables", _backup_migrate_default_structure_only_tables()),
      'filename' => variable_get("backup_migrate_file_name", _backup_migrate_default_filename()),
      'append_timestamp' => variable_get("backup_migrate_append_timestamp", FALSE) ? 1 : 0,
      'timestamp_format' => variable_get("backup_migrate_timestamp_format", 'Y-m-d\\TH-i-s'),
      'compression' => variable_get("backup_migrate_compression", "none"),
    );
  }
  else {
    $settings = _backup_migrate_profile_default_profile();
  }
  $settings['name'] = t('Default Profile');
  backup_migrate_profile_save_profile($settings);
}