You are here

function apachesolr_drush_solr_delete_index in Apache Solr Search 5.2

Same name and namespace in other branches
  1. 8 drush/apachesolr.drush.inc \apachesolr_drush_solr_delete_index()
  2. 6.3 drush/apachesolr.drush.inc \apachesolr_drush_solr_delete_index()
  3. 6 drush/apachesolr.drush.inc \apachesolr_drush_solr_delete_index()
  4. 6.2 drush/apachesolr.drush.inc \apachesolr_drush_solr_delete_index()
  5. 7 drush/apachesolr.drush.inc \apachesolr_drush_solr_delete_index()

Example drush command callback.

This is where the action takes place.

In this function, all of Drupals API is (usually) available, including any functions you have added in your own modules/themes.

To print something to the terminal window, use drush_print().

1 string reference to 'apachesolr_drush_solr_delete_index'
apachesolr_drush_command in ./apachesolr.drush.inc
Implementation of hook_drush_command().

File

./apachesolr.drush.inc, line 98
drush integration for apachesolr.

Code

function apachesolr_drush_solr_delete_index() {
  $args = func_get_args();
  $path = drupal_get_path('module', 'apachesolr');
  include_once $path . "/apachesolr.admin.inc";
  if (count($args) > 0) {
    foreach ($args as $type) {
      apachesolr_delete_index($type);
    }
  }
  else {
    apachesolr_delete_index();
  }
}