You are here

s3fs.drush.inc in S3 File System 7

Same filename and directory in other branches
  1. 8.2 s3fs.drush.inc
  2. 7.3 s3fs.drush.inc
  3. 7.2 s3fs.drush.inc

Defines a drush command that refreshes the S3 metadata cache.

File

s3fs.drush.inc
View source
<?php

/**
 * @file
 * Defines a drush command that refreshes the S3 metadata cache.
 */

/**
 * Implements hook_drush_command().
 */
function s3fs_drush_command() {
  $items = array();
  $items['s3fs-refresh-cache'] = array(
    'description' => t("Refreshes the S3 File System metadata cache. Your Amazon Web Services credentials, and the name of your site's bucket, must be configured first."),
    'aliases' => array(
      's3fs-rc',
    ),
    'callback' => 'drush_s3fs_refresh_cache',
  );
  return $items;
}

/**
 * Refreshes the file metadata cache.
 */
function drush_s3fs_refresh_cache() {
  $config = _s3fs_get_config();
  if (!empty($config['bucket'])) {
    _s3fs_refresh_cache($config);
  }
  else {
    drupal_set_message(t('Unable to determine Amazon S3 bucket name for cache refresh. Please set the bucket name in the S3 File System configuration settings and try again.'), 'error');
  }
}

Functions

Namesort descending Description
drush_s3fs_refresh_cache Refreshes the file metadata cache.
s3fs_drush_command Implements hook_drush_command().