You are here

function acquia_purge_requirements in Acquia Purge 6

Same name and namespace in other branches
  1. 7 acquia_purge.install \acquia_purge_requirements()

Implements hook_requirements().

File

./acquia_purge.install, line 27
Installation file for the Acquia Purge module.

Code

function acquia_purge_requirements($phase) {
  if ($phase == 'runtime') {
    $requirements = _acquia_purge_get_diagnosis();

    // Remove ACQUIA_PURGE_SEVLEVEL_OK results, they'll be too noisy.
    foreach ($requirements as $name => $result) {
      if ($result['severity'] === ACQUIA_PURGE_SEVLEVEL_OK) {
        unset($requirements[$name]);
      }
    }

    // Remove the status test once ERROR level results have been detected.
    if (count(_acquia_purge_get_diagnosis(ACQUIA_PURGE_SEVLEVEL_ERROR))) {
      unset($requirements['acquia_purge_status']);
    }
    return $requirements;
  }
  return array();
}