function drush_set_environment_vars

8.0.x environment.inc drush_set_environment_vars(array $site_record)
7.x environment.inc drush_set_environment_vars(array $site_record)
master environment.inc drush_set_environment_vars(array $site_record)

Set Env. Variables for given site-alias.

1 call to drush_set_environment_vars()
drush_preflight in includes/preflight.inc
During the initialization of Drush, this is the first step where we load our configuration and commandfiles, and select the site we are going to operate on; however, we take no irreversible actions (e.g. site bootstrapping). This allows commands that…

File

includes/environment.inc, line 863
Functions used by drush to query the environment and setting the current configuration.

Code

function drush_set_environment_vars(array $site_record) {
  if (!empty($site_record)) {
    $os = drush_os($site_record);
    if (isset($site_record['#env-vars'])) {
      foreach ($site_record['#env-vars'] as $var => $value) {
        $env_var = drush_escapeshellarg($var, $os, TRUE) . '=' . drush_escapeshellarg($value, $os, TRUE);
        putenv($env_var);
      }
    }
  }
}