You are here

function acquia_purge_purge_node in Acquia Purge 6

Same name and namespace in other branches
  1. 7 acquia_purge.deprecated.inc \acquia_purge_purge_node()

Purge the paths from a node from Varnish.

@returns Progress statistics from the queue manager. Associative array with the keys 'running', 'total', 'remaining', 'processed', 'percent' and 'purgehistory'.

Parameters

object $node: A Drupal node object that was just inserted or saved.

File

./acquia_purge.module, line 1111
Acquia Purge, Top-notch Varnish purging on Acquia Cloud!

Code

function acquia_purge_purge_node(&$node) {
  $paths = array(
    'node/' . $node->nid,
  );
  if (isset($node->path['alias']) && !empty($node->path['alias'])) {
    $paths[] = $node->path['alias'];
  }
  if (isset($node->promote) && $node->promote) {
    $paths[] = '<front>';
    $paths[] = 'rss.xml';
  }

  // Return the paths routine and return the statistics from the queue manager.
  return acquia_purge_purge_paths($paths);
}