You are here

function backup_migrate_source_db::backup_to_file in Backup and Migrate 6.3

Same name and namespace in other branches
  1. 8.3 includes/sources.db.inc \backup_migrate_source_db::backup_to_file()
  2. 7.3 includes/sources.db.inc \backup_migrate_source_db::backup_to_file()

Backup from this source.

File

includes/sources.db.inc, line 133
Functions to handle the direct to database destination.

Class

backup_migrate_source_db
A destination type for saving to a database server.

Code

function backup_to_file($file, $settings) {
  $file
    ->push_type($this
    ->get_file_type_id());

  // Switch to a different db if specified.
  $this
    ->switch_db();
  $this
    ->lock_tables($settings);
  $success = $this
    ->_backup_db_to_file($file, $settings);
  $this
    ->unlock_tables($settings);

  // Switch back to the previous db.
  $this
    ->switch_db(TRUE);
  return $success ? $file : FALSE;
}