You are here

function _acquia_purge_action_purge in Acquia Purge 7

Same name and namespace in other branches
  1. 6 acquia_purge.rules.inc \_acquia_purge_action_purge()

Action callback to the "Purge a path from Varnish on Acquia Cloud" rule.

Please note that this is Acquia Purge's original rule action, which got deprecated in release 7.x-1.0. It still works as it will just redirect its behavior to the new 'Clear pages on Acquia Cloud.' rule action, but we are actively warning people not to use it.

Parameters

string $urls_and_paths: User input string with absolute URL(s) or Drupal paths.

File

./acquia_purge.rules.inc, line 65
Rules integration that provides a purge action as rule action.

Code

function _acquia_purge_action_purge($urls_and_paths) {

  // Rule actions can run very often, and if we would write out a log warning
  // about the deprecation of this rule action every time, we can congest the
  // site. Instead, only put a warning in when the queue's absolutely empty.
  if (_acquia_purge_service()
    ->stats('total') === 0) {
    watchdog('acquia_purge', 'Please switch to using the rule action "Clear pages on Acquia Cloud."' . ' as soon as possible, this rule will disappear in future updates!', array(), WATCHDOG_ERROR);
  }

  // Relay execution to the new rule action, old rules will certainly still
  // work, if not run better with the added URLs support.
  _acquia_purge_action_flush_url($urls_and_paths);
}