You are here

function environment_force_init in Environment 6

Same name and namespace in other branches
  1. 7 modules/environment_force/environment_force.module \environment_force_init()

Implementation of hook_init().

File

modules/environment_force/environment_force.module, line 11
The Environment Force module resets the site environment to the one set in settings.php.

Code

function environment_force_init() {
  $env_override = variable_get('environment_override', NULL);
  if ($env_override) {
    $current_env = environment_current();
    if ($current_env != $env_override) {
      environment_switch($env_override);
    }
  }
}