You are here

function backup_migrate_destination_s3::s3_object in Backup and Migrate 6.3

Same name and namespace in other branches
  1. 8.2 includes/destinations.s3.inc \backup_migrate_destination_s3::s3_object()
  2. 8.3 includes/destinations.s3.inc \backup_migrate_destination_s3::s3_object()
  3. 6.2 includes/destinations.s3.inc \backup_migrate_destination_s3::s3_object()
  4. 7.3 includes/destinations.s3.inc \backup_migrate_destination_s3::s3_object()
  5. 7.2 includes/destinations.s3.inc \backup_migrate_destination_s3::s3_object()
5 calls to backup_migrate_destination_s3::s3_object()
backup_migrate_destination_s3::edit_form in includes/destinations.s3.inc
Get the form for the settings for this filter.
backup_migrate_destination_s3::load_file in includes/destinations.s3.inc
Load from the s3 destination.
backup_migrate_destination_s3::_delete_file in includes/destinations.s3.inc
Delete from the s3 destination.
backup_migrate_destination_s3::_list_files in includes/destinations.s3.inc
List all files from the s3 destination.
backup_migrate_destination_s3::_save_file in includes/destinations.s3.inc
Save to to the s3 destination.

File

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

Class

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

Code

function s3_object() {

  // Try to use libraries module if available to find the path.
  if (function_exists('libraries_get_path')) {
    $library_paths[] = libraries_get_path('s3-php5-curl');
  }
  else {
    $library_paths[] = 'sites/all/libraries/s3-php5-curl';
  }
  $library_paths[] = drupal_get_path('module', 'backup_migrate') . '/includes/s3-php5-curl';
  $library_paths[] = drupal_get_path('module', 'backup_migrate') . '/includes';
  foreach ($library_paths as $path) {
    if (file_exists($path . '/S3.php')) {
      require_once $path . '/S3.php';
      if (!$this->s3 && !empty($this->dest_url['user'])) {
        $this->s3 = new S3($this->dest_url['user'], $this->dest_url['pass']);
      }
      return $this->s3;
    }
  }
  drupal_set_message(t('Due to drupal.org code hosting policies, the S3 library needed to use an S3 destination is no longer distributed with this module. You must download the library from !link and place it in one of these locations: %locations.', array(
    '%locations' => implode(', ', $library_paths),
    '!link' => l('http://undesigned.org.za/2007/10/22/amazon-s3-php-class', 'http://undesigned.org.za/2007/10/22/amazon-s3-php-class'),
  )), 'error', FALSE);
  return NULL;
}