You are here

function amazons3_update_7201 in AmazonS3 7.2

Copy Amazon keys in the database from awssdk 1.x.

File

./amazons3.install, line 198
Install, update and uninstall functions for the AmazonS3 module.

Code

function amazons3_update_7201() {
  $t = get_t();
  drupal_set_message($t('AmazonS3 no longer requires the AWS SDK module.'));
  drupal_set_message($t('If your API keys are in settings.php, they will need to be renamed to amazons3_key and amazons3_secret. To avoid writing these values to the database, set amazons3_migrate_credentials to FALSE in settings.php.'));
  if (variable_get('amazons3_migrate_credentials', TRUE)) {
    if ($key = variable_get('aws_key', FALSE)) {
      variable_set('amazons3_key', $key);
    }
    if ($secret = variable_get('aws_secret', FALSE)) {
      variable_set('amazons3_secret', $secret);
    }
    drupal_set_message($t('Credentials have been migrated to AmazonS3 variables.'));
  }
}