You are here

function hook_acquia_purge_domains_alter in Acquia Purge 7

Alter the list of domains Acquia Purge operates on.

Modules may implement this hook to influence the domain names Acquia Purge is purging and have more narrow control over it. Although it is generally discouraged to do this, it does make sense in complexer scenarios with many domains that need to be reduced to stay under the diagnostic limit.

Parameters

string[] $domains: Unassociative array with domain names as string values.

See also

AcquiaPurgeHostingInfo::getDomains()

1 invocation of hook_acquia_purge_domains_alter()
AcquiaPurgeHostingInfo::domainsAlter in lib/AcquiaPurgeHostingInfo.php
Fire off hook_acquia_purge_domains_alter().

File

./acquia_purge.api.php, line 60
Hooks provided by the Acquia Purge module.

Code

function hook_acquia_purge_domains_alter(array &$domains) {
  $blacklist = array(
    'domain_a',
    'domain_b',
  );
  foreach ($domains as $i => $domain) {
    if (in_array($domain, $blacklist)) {
      unset($domains[$i]);
    }
  }
  $domains[] = 'my_domain';
}