You are here

function drush_node_revision_delete_nrd_delete_cron_run in Node Revision Delete 7.3

Same name and namespace in other branches
  1. 8 node_revision_delete.drush.inc \drush_node_revision_delete_nrd_delete_cron_run()

Callback for the nrd-delete-cron-run command.

File

./node_revision_delete.drush.inc, line 249

Code

function drush_node_revision_delete_nrd_delete_cron_run() {
  $args = func_get_args();

  // Getting or setting values?
  if (isset($args[0])) {

    // Saving the values in the config.
    variable_set('node_revision_delete_cron', $args[0]);
    $message = dt('The module was configurated to delete @revisions revisions per cron run.', array(
      '@revisions' => $args[0],
    ));
    drush_log($message, 'success');
  }
  else {

    // Getting the values from the config.
    $revisions = variable_get('node_revision_delete_cron');
    $message = dt('The revisions quantity to delete per cron run is: @revisions.', array(
      '@revisions' => $revisions,
    ));
    drush_print($message);
  }
}