You are here

public function backup_migrate_destination_dropbox::save_file in Backup and Migrate Dropbox 7.3

Same name and namespace in other branches
  1. 6.2 destinations.dropbox.inc \backup_migrate_destination_dropbox::save_file()
  2. 6 destinations.dropbox.inc \backup_migrate_destination_dropbox::save_file()
  3. 7 destinations.dropbox.inc \backup_migrate_destination_dropbox::save_file()
  4. 7.2 destinations.dropbox.inc \backup_migrate_destination_dropbox::save_file()

File

./destinations.dropbox.inc, line 402
destinations.dropbox.inc

Class

backup_migrate_destination_dropbox
A destination for sending database backups to a Dropbox account.

Code

public function save_file($file, $settings) {

  // Smart caching: update the cache instead of clearing it.
  $this->prevent_cache_clear = true;
  $result = parent::save_file($file, $settings);

  // Add to the cache. The cache normally only contains the backup file
  // entries, not the info entries as these are deleted form the files list
  // when their info is merged into the info of the backup file itself.
  // So we only add the backup file itself. (Thus this code is correctly
  // placed here in save_file() and not in _save_file().)
  $files = $this
    ->file_cache_get();
  $filename = $file->name . '.' . implode('.', $file->ext);
  $files[$filename] = $file;
  $this
    ->file_cache_set($files);
  $this->prevent_cache_clear = false;
  return $result;
}