You are here

function drupal_check_incompatibility in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/includes/common.inc \drupal_check_incompatibility()

Checks whether a version is compatible with a given dependency.

Parameters

$v: A parsed dependency structure e.g. from ModuleHandler::parseDependency().

$current_version: The version to check against (like 4.2).

Return value

NULL if compatible, otherwise the original dependency version string that caused the incompatibility.

See also

\Drupal\Core\Extension\ModuleHandler::parseDependency()

2 calls to drupal_check_incompatibility()
ModulesListForm::buildRow in core/modules/system/src/Form/ModulesListForm.php
Builds a table row for the system modules page.
system_requirements in core/modules/system/system.install
Implements hook_requirements().

File

core/includes/common.inc, line 1203
Common functions that many Drupal modules will need to reference.

Code

function drupal_check_incompatibility($v, $current_version) {
  if (!empty($v['versions'])) {
    foreach ($v['versions'] as $required_version) {
      if (isset($required_version['op']) && !version_compare($current_version, $required_version['version'], $required_version['op'])) {
        return $v['original_version'];
      }
    }
  }
}