You are here

function purge_configure in Purge 7.2

(Re)Configure. Loads all API provided bundles.

File

includes/purge.inc, line 52
Contains the main purging functionality and error handling.

Code

function purge_configure($api = NULL) {

  // Start out by fetching the currently configured bundle.
  $bundle = new PurgePurgerBundleAPI();

  // Invoke hook_purge_configure to get the api bundle.
  $api_modules = module_implements('purge_configure');
  foreach ($api_modules as $api_module) {
    $api_bundle = module_invoke($api_module, 'purge_configure', $api);

    // Merge the API bundle into the main one.
    $bundle
      ->merge($api_bundle);
  }

  // Save the bundle.
  $bundle
    ->save();
}