function drush_set_environment_vars

8.0.x drush_set_environment_vars(array $site_record)
7.x drush_set_environment_vars(array $site_record)
master 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/
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…


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


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);