You are here

function fastly_rules_action_purge_by_urls in Fastly 7

Rules action to purge the specified URL(s).

Parameters

array $urls: Array with user-defined URLs and internal paths.

File

./fastly.rules.inc, line 49
Integration with the Rules module.

Code

function fastly_rules_action_purge_by_urls($urls) {
  $api = fastly_get_api();
  foreach (explode("\r\n", $urls) as $line) {
    $api
      ->purgePath(trim($line));
  }
}