public function backup_migrate_destination_db::save_file in Backup and Migrate 7.3
Same name and namespace in other branches
- 8.2 includes/destinations.db.inc \backup_migrate_destination_db::save_file()
- 8.3 includes/destinations.db.inc \backup_migrate_destination_db::save_file()
- 6.2 includes/destinations.db.inc \backup_migrate_destination_db::save_file()
- 7.2 includes/destinations.db.inc \backup_migrate_destination_db::save_file()
Save the info by importing it into the database.
Overrides backup_migrate_destination::save_file
File
- includes/
destinations.db.inc, line 28 - Functions to handle the direct to database destination.
Class
- backup_migrate_destination_db
- A destination type for saving to a database server.
Code
public function save_file($file, $settings) {
require_once dirname(__FILE__) . '/files.inc';
// Set the source_id to the destination_id in the settings since for a restore, the source_id is the
// database that gets restored to.
$settings
->set_source($this
->get_id());
// Restore the file to the source database.
$file = backup_migrate_perform_restore($this
->get_id(), $file, $settings);
return $file;
}