function backup_migrate_destination_db::restore_from_file

cis7 backup_migrate_destination_db::restore_from_file($file, &$settings)
cle7 backup_migrate_destination_db::restore_from_file($file, &$settings)
elmsmedia7 backup_migrate_destination_db::restore_from_file($file, &$settings)
icor7 backup_migrate_destination_db::restore_from_file($file, &$settings)
meedjum_blog7 backup_migrate_destination_db::restore_from_file($file, &$settings)
mooc7 backup_migrate_destination_db::restore_from_file($file, &$settings)

Restore to this source.


sites/all/modules/ulmus/backup_migrate/includes/, line 164
Functions to handle the direct to database destination.


A destination type for saving to a database server.


function restore_from_file($file, &$settings) {
  $num = 0;
  $type = $this->get_file_type_id();
  // Open the file using the file wrapper. Check that the dump is of the right type (allow .sql for legacy reasons).
  if ($file->type_id() !== $this->get_file_type_id() && $file->type_id() !== 'sql') {
    _backup_migrate_message("Unable to restore from file %file because a %type file can't be restored to this database.", array("%file" => $file->filepath(), '%type' => $file->type_id()), 'error');
  else {
    backup_migrate_filters_invoke_all('pre_restore', $file, $settings);

    // Restore the database.
    $num = $this->_restore_db_from_file($file, $settings);
    $settings->performed_action = $num ? t('%num SQL commands executed.', array('%num' => $num)) : '';

    backup_migrate_filters_invoke_all('post_restore', $file, $settings, $num);
  return $num;