You are here

public static function Vars::api in Variable API 6.2

Same name and namespace in other branches
  1. 7.2 vars.classes.inc \Vars::api()

Verifies the current API version is included between two values passed as arguments.

Parameters

$minimum: The minimum API version required.

$maximum: The maximum version required. This argument is optional; the current API will be checked against this value only if it is passed to the function.

Return value

TRUE, if the current API version is included between the passed values.

File

./vars.module, line 70
Implement an API to handle persistent variables.

Class

Vars
@file Implement an API to handle persistent variables.

Code

public static function api($minimum, $maximum = NULL) {
  if (version_compare(self::API_VERSION, $minimum, '<')) {
    return FALSE;
  }
  if (isset($maximum) && version_compare(self::API_VERSION, $maximum, '>')) {
    return FALSE;
  }
  return TRUE;
}