You are here

function drush_prod_monitor_flush in Production check & Production monitor 6

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

Flush data callback.

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

File

prod_monitor/prod_monitor.drush.inc, line 101

Code

function drush_prod_monitor_flush() {
  $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 flush all data for') . ' ' . $url . '?')) {
        drush_die('Aborting.');
      }
      $result = _prod_monitor_flush_data($arg);
      if ($result === FALSE) {
        drush_print("\33[1;31m" . dt('Error:') . " \33[0m" . dt('Unable to flush data!'));
      }
      else {
        drush_print(dt('Stored data successfully flushed.'));
      }
    }
    else {
      drush_print("\33[1;31m" . dt('Error:') . " \33[0m" . dt('No site found with ID') . ' ' . $arg . '!');
    }
  }
}