You are here

function drupal_requirements_severity in Drupal 9

Same name and namespace in other branches
  1. 8 core/includes/install.inc \drupal_requirements_severity()
  2. 5 includes/install.inc \drupal_requirements_severity()
  3. 6 includes/install.inc \drupal_requirements_severity()
  4. 7 includes/install.inc \drupal_requirements_severity()

Extracts the highest severity from the requirements array.

Parameters

$requirements: An array of requirements, in the same format as is returned by hook_requirements().

Return value

The highest severity in the array.

3 calls to drupal_requirements_severity()
DbUpdateController::handle in core/modules/system/src/Controller/DbUpdateController.php
Returns a database update page.
drupal_check_module in core/includes/install.inc
Checks a module's requirements.
install_display_requirements in core/includes/install.core.inc
Displays installation requirements.

File

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

Code

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