You are here

function votingapi_drush_command in Voting API 7.2

Same name and namespace in other branches
  1. 8.3 votingapi.drush.inc \votingapi_drush_command()
  2. 7.3 votingapi.drush.inc \votingapi_drush_command()

Implements of hook_drush_command().

File

./votingapi.drush.inc, line 26
Drush commands to generate votingapi votes, recalculate results for existing votes, or flush VotingAPI data entirely.

Code

function votingapi_drush_command() {
  $items['generate-votes'] = array(
    'description' => 'Creates dummy voting data.',
    'arguments' => array(
      'entity_type' => 'The type of entity to generate votes for.',
      'vote_type' => 'The type of votes to generate, defaults to \'percent\'.',
    ),
    'drupal dependencies' => array(
      'devel_generate',
    ),
    'options' => array(
      'kill' => 'Specify \'kill\' to delete all existing votes before generating new ones.',
      'age' => 'The maximum age, in seconds, of each vote.',
      'node_types' => 'A comma delimited list of node types to generate votes for, if the entity type is \'node\'.',
    ),
    'aliases' => array(
      'genv',
    ),
  );
  $items['votingapi-recalculate'] = array(
    'description' => 'Regenerates voting results from raw vote data.',
    'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_LOGIN,
    // Various D7 code assumes we have a uid.
    'arguments' => array(
      'entity_type' => 'The type of entity to recalculate vote results for.',
    ),
    'aliases' => array(
      'vcalc',
    ),
  );
  $items['votingapi-flush'] = array(
    'description' => 'Deletes all existing voting data.',
    'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_LOGIN,
    // Various D7 code assumes we have a uid.
    'arguments' => array(
      'entity_type' => 'The type of entity whose voting data should be flushed.',
    ),
    'aliases' => array(
      'vflush',
    ),
  );
  return $items;
}