1 backup.database.inc public BackupDatabase::backup(BackupFile $file)

Run the full backup process, including generating the backup and saving it.

Parameters

BackupFile $file: A BackupFile instance, used to write to the file handle.

Return value

boolean: TRUE if the backup was successful, FALSE on failure.

Overrides Backup::backup

File

core/includes/backup/backup.database.inc, line 218
Functions to handle the direct to/from database backup source.

Class

BackupDatabase
A destination type for saving to a database server.

Code

public function backup(BackupFile $file) {
  $file->pushExtension($this->getFileTypeId());

  if ($this->settings['lock_tables']) {
    $this->lockTables();
  }

  // Switch to a different db if specified.
  $success = $this->backupDatabaseToFile($file);

  if ($this->settings['lock_tables']) {
    $this->unlockTables();
  }

  // Pull any logged messages out of the file and up to this class.
  $file_log = $file->getLog();
  foreach ($file_log as $log) {
    call_user_func_array($this->log, $log);
  }
  $file->clearLog();

  return $success ? $file : FALSE;
}