1 backup.config.inc public BackupConfig::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.config.inc, line 15
Contains the Backup base class.

Class

BackupConfig
Base class for creating backups.

Code

public function backup(BackupFile $file) {
  $config_type = $this->getConfigType();
  if (!$config_type) {
    return FALSE;
  }

  $file->pushExtension('tar');
  $file->pushExtension('gz');
  $file_path = $file->filePath();
  $config_storage = config_get_config_storage($config_type);
  try {
    $config_storage->exportArchive($file_path);
  }
  catch (ConfigStorageException $e) {
    $this->log($e->getMessage(), array(), 'error');
    return FALSE;
  }

  return TRUE;
}