You are here

function akamai_drush_clear_url in Akamai 7.3

Same name and namespace in other branches
  1. 7.2 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 35
Drush commands for interacting with Akamai's CCU API.

Code

function akamai_drush_clear_url() {
  $paths = func_get_args();
  $overrides = array();
  if (drush_get_option('action')) {
    $overrides['action'] = drush_get_option('action');
  }
  if (drush_get_option('domain')) {
    $overrides['domain'] = drush_get_option('domain');
  }
  $did_clear = akamai_purge_path($paths, $overrides);
  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."));
  }
}