You are here

function habitat_ensure_habitat in Habitat 7

1 call to habitat_ensure_habitat()
habitat_init in ./habitat.module
Implements hook_init().

File

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

Code

function habitat_ensure_habitat() {
  $variable = variable_get('habitat_variable', 'fetcher_environment');
  if ($habitat = variable_get($variable, FALSE)) {
    $clear_caches = habitat_ensure_modules_disabled($habitat);
    $clear_caches |= habitat_ensure_modules_enabled($habitat);
    if ($clear_caches) {
      system_flush_caches();
    }
  }
}