You are here

public function backup_migrate_destination_s3::_list_files in Backup and Migrate 7.3

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

List all files from the s3 destination.

Overrides backup_migrate_destination::_list_files

File

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

Class

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

Code

public function _list_files() {
  require_once dirname(__FILE__) . '/files.inc';
  $files = array();
  if ($s3 = $this
    ->s3_object()) {
    $s3_files = $s3
      ->getBucket($this
      ->get_bucket(), $this
      ->get_subdir());
    foreach ((array) $s3_files as $id => $file) {
      $info = array(
        'filename' => $this
          ->local_path($file['name']),
        'filesize' => $file['size'],
        'filetime' => $file['time'],
      );
      $files[$info['filename']] = new backup_file($info);
    }
  }
  return $files;
}