You are here

function drush_s3fs_copy_local in S3 File System 7.2

Same name and namespace in other branches
  1. 8.2 s3fs.drush.inc \drush_s3fs_copy_local()
  2. 7.3 s3fs.drush.inc \drush_s3fs_copy_local()

Copys all files from the local public/private filesystem folders into S3, if s3fs is configured to take over those systems.

1 string reference to 'drush_s3fs_copy_local'
s3fs_drush_command in ./s3fs.drush.inc
Implements hook_drush_command().

File

./s3fs.drush.inc, line 47
Defines a drush command that refreshes the S3 metadata cache.

Code

function drush_s3fs_copy_local() {
  $config = _s3fs_get_config();
  if (!_s3fs_validate_config($config)) {
    drupal_set_message(dt('Unable to validate your s3fs configuration settings. Please configure S3 File System from the admin/config/media/s3fs page and try again.'), 'error');
    return;
  }
  if (empty($config['use_s3_for_public']) && empty($config['use_s3_for_private'])) {
    drupal_set_message(dt('S3 File System is not configured to take over any other file systems.'));
    return;
  }
  if (!empty($config['use_s3_for_public'])) {
    _s3fs_copy_file_system_to_s3('public');
  }
  if (!empty($config['use_s3_for_private'])) {
    _s3fs_copy_file_system_to_s3('private');
  }
}