You are here

function habitat_requirements in Habitat 7

Implements hook_requirements().

File

./habitat.module, line 59
Change enabled modules based on current environment.

Code

function habitat_requirements($phase) {
  if ($phase == 'runtime') {
    $variable = variable_get('habitat_variable', 'fetcher_environment');
    $habitat = variable_get($variable, FALSE);
    return array(
      'habitat' => array(
        'title' => 'Habitat',
        'value' => $habitat ? $habitat : 'Not defined',
        'description' => 'The habitat defined on the current environment.',
        'severity' => $habitat ? REQUIREMENT_OK : REQUIREMENT_WARNING,
      ),
    );
  }
}