You are here

function backup_migrate_destination_s3::load_file in Backup and Migrate 8.2

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

Load from the s3 destination.

Overrides backup_migrate_destination::load_file

File

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

Class

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

Code

function load_file($file_id) {
  backup_migrate_include('files');
  $file = new backup_file(array(
    'filename' => $file_id,
  ));
  if ($s3 = $this
    ->s3_object()) {
    $data = $s3
      ->getObject($this
      ->get_bucket(), $this
      ->remote_path($file_id), $file
      ->filepath());
    if (!$data->error) {
      return $file;
    }
  }
  return NULL;
}