You are here

function environment_set in Environment 8

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

Se the new environment.

Parameters

string $new_env: Machine name of the new system environment.

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

File

./environment.module, line 98
Module for handling changes in server environments

Code

function environment_set($new_env) {
  \Drupal::configFactory()
    ->getEditable('environment.settings')
    ->set('environment', $new_env)
    ->save();
}