function environment_set in Environment 7
Same name and namespace in other branches
- 8 environment.module \environment_set()
- 6 environment.module \environment_set()
Save the new environment to it's assigned workflow.
Parameters
string $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 205 - Module for handling changes in server environments
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);
}