function backup_migrate_destination_dropbox::_save_file in Backup and Migrate Dropbox 7.3
Same name and namespace in other branches
- 7.2 destinations.dropbox.inc \backup_migrate_destination_dropbox::_save_file()
Saves a file to the Dropbox destination.
Parameters
backup_file $file:
backup_migrate_profile $settings:
Return value
backup_file|null
File
- ./
destinations.dropbox.inc, line 314 - destinations.dropbox.inc
Class
- backup_migrate_destination_dropbox
- A destination for sending database backups to a Dropbox account.
Code
function _save_file($file, $settings) {
try {
$filename = $file->name . '.' . implode('.', $file->ext);
$path = $this
->remote_path($filename);
$this
->get_dropbox_api()
->file_upload($file
->filepath(), $path);
} catch (Exception $e) {
watchdog('backup_migrate', 'Backup Migrate Dropbox Error: ' . $e
->getMessage(), [], WATCHDOG_ERROR);
drupal_set_message('Backup Migrate Dropbox Error: ' . $e
->getMessage(), 'error');
return NULL;
}
return $file;
}