You are here

function acquia_purge_init in Acquia Purge 6

Same name and namespace in other branches
  1. 7 acquia_purge.module \acquia_purge_init()

Implements hook_init().

File

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

Code

function acquia_purge_init() {

  // Abort loading the AJAX logic when hitting any of the excluded paths.
  $excluded_auto_purging_paths = array(
    '',
    'admin/reports/status',
    'admin/reports/dblog',
    'acquia_purge_ajax_processor',
    'media/browser',
    'media/browser/testbed',
    'media/browser/list',
    'media/browser/library',
  );
  if (in_array($_GET['q'], $excluded_auto_purging_paths)) {
    return;
  }

  // Detect if the current user instantiated a ongoing purge in the queues.
  if (_acquia_purge_queue_is_user_purging()) {

    // Trigger the client side candy so it starts doing its work.
    _acquia_purge_trigger_client_side_purging();
  }
}