You are here

function expire_drush_command in Cache Expiration 7.2

Same name and namespace in other branches
  1. 6 expire.drush.inc \expire_drush_command()
  2. 7 expire.drush.inc \expire_drush_command()

Implements hook_drush_command().

File

./expire.drush.inc, line 11
This is the drush integration for the expire module.

Code

function expire_drush_command() {

  // Expire absolute URLs.
  $items['expire-url'] = array(
    'description' => 'Expire fully qualified URLs.',
    'arguments' => array(
      'urls' => 'URLs to expire separated by spaces.',
    ),
    'examples' => array(
      'drush expire-url http://example.com/testpage.html' => 'Expire a single URL.',
      'drush xp-url http://example.com/ http://test.com/logo.jpg' => 'Expire multiple URLs.',
    ),
    'aliases' => array(
      'xp-url',
    ),
    'drupal dependencies' => array(
      'expire',
    ),
    'callback' => 'drush_expire_absolute_url',
  );

  // Expire internal paths.
  $items['expire-path'] = array(
    'description' => 'Expire a drupal path.',
    'arguments' => array(
      'paths' => 'A list drupal paths to expire separated by spaces.',
    ),
    'examples' => array(
      'drush expire-path node/123' => 'Expire a single drupal path.',
      'drush expire-path FRONT' => 'Expire the front page.',
      'drush xp-path FRONT node/234 contact' => 'Expire multiple drupal paths.',
    ),
    'aliases' => array(
      'xp-path',
    ),
    'drupal dependencies' => array(
      'expire',
    ),
    'callback' => 'drush_expire_internal_path',
  );

  // Expire node objects.
  $items['expire-node'] = array(
    'description' => 'Expire a node by node ID.',
    'arguments' => array(
      'nids' => 'Numeric node-ids to expire separated by spaces.',
    ),
    'examples' => array(
      'drush expire-node 2' => 'Expire single node by node ID.',
      'drush xp-node 2 24 612' => 'Expire multiple nodes by node IDs.',
    ),
    'aliases' => array(
      'xp-node',
    ),
    'drupal dependencies' => array(
      'expire',
    ),
    'callback' => 'drush_expire_node',
  );

  // Expire taxonomy term objects.
  $items['expire-term'] = array(
    'description' => 'Expire a taxonomy term by term ID.',
    'arguments' => array(
      'tids' => 'Numeric term ids to expire separated by spaces.',
    ),
    'examples' => array(
      'drush expire-term 2' => 'Expire single taxonomy term by term ID.',
      'drush xp-term 2 24 612' => 'Expire multiple taxonomy terms by term IDs.',
    ),
    'aliases' => array(
      'xp-term',
    ),
    'drupal dependencies' => array(
      'expire',
    ),
    'callback' => 'drush_expire_term',
  );

  // Expire user objects.
  $items['expire-user'] = array(
    'description' => 'Expire a user by user ID.',
    'arguments' => array(
      'uids' => 'Numeric user IDs to expire separated by spaces.',
    ),
    'examples' => array(
      'drush expire-user 2' => 'Expire single user by his ID.',
      'drush xp-user 2 24 612' => 'Expire multiple users by their IDs.',
    ),
    'aliases' => array(
      'xp-user',
    ),
    'drupal dependencies' => array(
      'expire',
    ),
    'callback' => 'drush_expire_user',
  );

  // Expire comment objects.
  $items['expire-comment'] = array(
    'description' => 'Expire a comment by comment ID.',
    'arguments' => array(
      'cids' => 'Numeric comment IDs to expire separated by spaces.',
    ),
    'examples' => array(
      'drush expire-comment 2' => 'Expire single comment by its ID.',
      'drush xp-comment 2 24 612' => 'Expire multiple comments by their IDs.',
    ),
    'aliases' => array(
      'xp-comment',
    ),
    'drupal dependencies' => array(
      'expire',
      'comment',
    ),
    'callback' => 'drush_expire_comment',
  );
  return $items;
}