1.20.x install.inc backdrop_requirements_severity(&$requirements)

Extracts the highest severity from the requirements array.

Parameters

$requirements: An array of requirements as returned by system_get_requirements().

Return value

The highest severity in the array.:

See also

system_get_requirements().

File

includes/install.inc, line 1432
API functions for installing modules and themes.

Code

function backdrop_requirements_severity(&$requirements) {
  $severity = REQUIREMENT_OK;
  foreach ($requirements as $requirement) {
    if (isset($requirement['severity'])) {
      $severity = max($severity, $requirement['severity']);
    }
  }
  return $severity;
}