You are here

function variable_info in Variable 6

Get variable information

Variable information is collected from modules and cached by language

12 calls to variable_info()
variable_access in ./variable.module
Check access to variable
variable_admin_build_groups in variable_admin/variable_admin.pages.inc
Build variable groups
variable_admin_page_edit in variable_admin/variable_admin.pages.inc
Edit variable
variable_admin_page_modules in variable_admin/variable_admin.pages.inc
Variable overview, by module
variable_admin_page_undefined in variable_admin/variable_admin.pages.inc
List of variables in db not declared by any module

... See full list

File

./variable.module, line 174
Variable API module

Code

function variable_info($name = NULL, $options = array()) {
  static $info;
  $options += variable_status();
  $language = $options['language'];
  if (!isset($info)) {
    $info =& variable_static('variable_info');
  }
  if (empty($info) || !isset($info[$language->language])) {
    if ($cache = variable_cache_get('variable_info', $language->language)) {
      $info[$language->language] = $cache->data;
    }
    else {
      variable_include();
      $info[$language->language] = variable_build_info($options);
      variable_cache_set('variable_info', $info[$language->language], $language->language);
    }
  }
  if ($name) {
    return isset($info[$language->language][$name]) ? $info[$language->language][$name] : array();
  }
  else {
    return $info[$language->language];
  }
}