You are here

function drush_prod_monitor_delsite in Production check & Production monitor 6

Same name and namespace in other branches
  1. 7 prod_monitor/prod_monitor.drush.inc \drush_prod_monitor_delsite()

Delete site callback.

1 string reference to 'drush_prod_monitor_delsite'
prod_monitor_drush_command in prod_monitor/prod_monitor.drush.inc
Implementation of hook_drush_command().

File

prod_monitor/prod_monitor.drush.inc, line 126

Code

function drush_prod_monitor_delsite() {
  $args = func_get_args();
  foreach ($args as $arg) {
    $url = _prod_monitor_get_url($arg);
    if (!empty($url)) {
      if (!drush_confirm(dt("Do you really want to delete") . ' ' . $url . ' ' . dt('and all its data?'))) {
        drush_die('Aborting.');
      }
      $result = _prod_monitor_delete_site($arg);
      if ($result === FALSE) {
        drush_print("\33[1;31m" . dt('Error:') . " \33[0m" . dt('Unable to delete') . $url . '!');
      }
      else {
        drush_print(dt('Website successfully deleted.'));
      }
    }
    else {
      drush_print("\33[1;31m" . dt('Error:') . " \33[0m" . dt('No site found with ID') . ' ' . $arg . '!');
    }
  }
}