function drush_set_config_options

8.0.x context.inc drush_set_config_options($context, $options, $override = array())
6.x context.inc drush_set_config_options($context, $options, $override = array())
7.x context.inc drush_set_config_options($context, $options, $override = array())
3.x context.inc drush_set_config_options($context, $options, $override = array())
4.x context.inc drush_set_config_options($context, $options, $override = array())
5.x context.inc drush_set_config_options($context, $options, $override = array())
master context.inc drush_set_config_options($context, $options, $override = array())
2 calls to drush_set_config_options()
drush_load_config_file in includes/context.inc
drush_sitealias_set_alias_context in includes/sitealias.inc
Given a site alias record, copy selected fields from it into the drush 'alias' context. The 'alias' context has lower precedence than the 'options' context, so values set by an alias record can be overridden by…

File

includes/context.inc, line 159
The Drush context API implementation.

Code

function drush_set_config_options($context, $options, $override = array()) {
  global $drush_conf_override;

  // Only reset $drush_conf_override if the array is not set, otherwise keep old values and append new values to it.
  if (!isset($drush_conf_override)) {
    $drush_conf_override = array();
  }

  // Copy 'config-file' into 'context-path', converting to an array to hold multiple values if necessary
  if (isset($options['config-file'])) {
    if (isset($options['context-path'])) {
      $options['context-path'] = array_merge(array($options['config-file']), is_array($options['context-path']) ? $options['context-path'] : array($options['context-path']));
    }
    else {
      $options['context-path'] = $options['config-file'];
    }
  }

  // Take out $aliases and $command_specific options
  drush_set_config_special_contexts($options);

  drush_set_context($context, $options);

  // Instruct core not to store queries since we are not outputting them.
  // This can be overridden by a command or a drushrc file if needed.
  if (!isset($drush_conf_override['dev_query'])) {
    $drush_conf_override['dev_query'] = FALSE;
  }

  /**
   * Allow the drushrc.php file to override $conf settings.
   * This is a separate variable because the $conf array gets
   * initialized to an empty array, in the drupal bootstrap process,
   * and changes in settings.php would wipe out the drushrc.php settings.
   */
  if (!empty($override)) {
    $drush_conf_override = array_merge($drush_conf_override, $override);
  }
}