public function backup_migrate_destination_dropbox::_delete_file in Backup and Migrate Dropbox 7.3
Same name and namespace in other branches
- 7.2 destinations.dropbox.inc \backup_migrate_destination_dropbox::_delete_file()
Deletes a file on Dropbox.
Parameters
string $file_id:
File
- ./
destinations.dropbox.inc, line 334 - destinations.dropbox.inc
Class
- backup_migrate_destination_dropbox
- A destination for sending database backups to a Dropbox account.
Code
public function _delete_file($file_id) {
try {
$path = $this
->remote_path($file_id);
$this
->get_dropbox_api()
->file_delete($path);
} catch (Exception $e) {
// Ignore file not found errors
if (strpos($e
->getMessage(), 'path_lookup/not_found') !== FALSE) {
watchdog('backup_migrate', 'Backup Migrate Dropbox Error: ' . $e
->getMessage(), [], WATCHDOG_ERROR);
drupal_set_message('Backup Migrate Dropbox Error: ' . $e
->getMessage(), 'error');
}
}
}