Error message

You are browsing documentation for drupal 7.x, which is not supported anymore. Read the updated version of this page for drupal 11.x (the latest version).

function drupal_check_incompatibility

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

Checks whether a version is compatible with a given dependency.

Parameters

$v: The parsed dependency structure from drupal_parse_dependency().

$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_parse_dependency()

2 calls to drupal_check_incompatibility()
system_modules in modules/system/system.admin.inc
Menu callback; provides module enable/disable interface.
system_requirements in modules/system/system.install
Implements hook_requirements().

File

includes/common.inc, line 8003

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'];
 }
 }
 }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.