You are here

function backup_migrate_destination_s3::_save_file in Backup and Migrate 6.2

Same name and namespace in other branches
  1. 8.2 includes/destinations.s3.inc \backup_migrate_destination_s3::_save_file()
  2. 8.3 includes/destinations.s3.inc \backup_migrate_destination_s3::_save_file()
  3. 6.3 includes/destinations.s3.inc \backup_migrate_destination_s3::_save_file()
  4. 7.3 includes/destinations.s3.inc \backup_migrate_destination_s3::_save_file()
  5. 7.2 includes/destinations.s3.inc \backup_migrate_destination_s3::_save_file()

Save to to the s3 destination.

Overrides backup_migrate_destination::_save_file

File

includes/destinations.s3.inc, line 23
Functions to handle the s3 backup destination.

Class

backup_migrate_destination_s3
A destination for sending database backups to an s3 server.

Code

function _save_file($file, $settings) {
  if ($s3 = $this
    ->s3_object()) {
    $path = $file
      ->filename();
    if ($s3
      ->putObject($s3
      ->inputFile($file
      ->filepath(), FALSE), $this
      ->get_bucket(), $this
      ->remote_path($file
      ->filename()), S3::ACL_PRIVATE)) {
      return $file;
    }
  }
  return FALSE;
}