You are here

function environment_set in Environment 6

Same name and namespace in other branches
  1. 8 environment.module \environment_set()
  2. 7 environment.module \environment_set()

Save the new environment to it's assigned workflow.

Parameters

$new_env: Machine name of the new system environment. If environment has a workflow

1 call to environment_set()
environment_switch in ./environment.module
Switches between two environments.

File

./environment.module, line 209

Code

function environment_set($new_env) {
  $environment = variable_get('environment', array());
  $new_state = environment_load($new_env);

  // Maintain backwards compatibility with pre-workflow systems.
  if (!is_array($environment)) {
    $environment = array(
      'default' => $environment,
    );
  }
  $environment[$new_state['workflow']] = $new_state['name'];
  variable_set('environment', $environment);
}