You are here

function akamai_drush_clear_url in Akamai 7.2

Same name and namespace in other branches
  1. 7.3 akamai.drush.inc \akamai_drush_clear_url()

Callback function for ak-clear-url command.

Runs the akamai clear url command

1 string reference to 'akamai_drush_clear_url'
akamai_drush_command in ./akamai.drush.inc
Implements hook_drush_command().

File

./akamai.drush.inc, line 30

Code

function akamai_drush_clear_url() {
  $paths = func_get_args();
  $overrides = array();
  if (drush_get_option('action')) {
    $overrides['action'] = drush_get_optons('action');
  }
  if (drush_get_option('domain')) {
    $overrides['domain'] = drush_get_optons('domain');
  }
  $did_clear = akamai_clear_url($paths, $overrides, NULL);
  if ($did_clear) {
    $message = t("Akamai Cache Request has been made successfully, please allow 10 minutes for changes to take effect.\n") . print_r($paths, TRUE);
    drush_print("{$message}\n");
  }
  else {
    drush_set_error(t("There was a problem with your cache control request."));
  }
}