function drush_set_config_special_contexts

8.0.x drush_set_config_special_contexts(&$options)
6.x drush_set_config_special_contexts(&$options)
7.x drush_set_config_special_contexts(&$options)
3.x drush_set_config_special_contexts(&$options)
4.x drush_set_config_special_contexts(&$options)
5.x drush_set_config_special_contexts(&$options)
master drush_set_config_special_contexts(&$options)

There are certain options such as 'site-aliases' and 'command-specific' that must be merged together if defined in multiple drush configuration files. If we did not do this merge, then the last configuration file that defined any of these properties would overwrite all of the options that came before in previously-loaded configuration files. We place all of them into their own context so that this does not happen.

5 calls to drush_set_config_special_contexts()
drush_set_config_options in includes/
drush_sitealias_get_record in includes/
Get a site alias record given an alias name or site specification.
drush_sitealias_load_all in includes/
Load every alias file that can be found anywhere in the alias search path.
_drush_sitealias_find_and_load_alias in includes/
Worker function called by _drush_sitealias_load_alias and drush_sitealias_load_all. Traverses the alias search path and finds the specified alias record.
_drush_sitealias_load_alias in includes/
Check and see if an alias definition for $alias is available. If it is, load it into the list of aliases cached in the 'site-aliases' context.


includes/, line 207
The Drush context API implementation.


function drush_set_config_special_contexts(&$options) {
  if (isset($options)) {
    $has_command_specific = array_key_exists('command-specific', $options);
    // Change the keys of the site aliases from 'alias' to '@alias'
    if (array_key_exists('site-aliases', $options)) {
      $user_aliases = $options['site-aliases'];
      $options['site-aliases'] = array();
      foreach ($user_aliases as $alias_name => $alias_value) {
        if (substr($alias_name, 0, 1) != '@') {
          $alias_name = "@$alias_name";
        $options['site-aliases'][$alias_name] = $alias_value;

    // Copy site aliases and command-specific options into their
    // appropriate caches.
    foreach (array('site-aliases', 'command-specific') as $option_name) {
      if ((isset($options)) && (array_key_exists($option_name, $options))) {
        $cache = &drush_get_context($option_name);
        $cache = array_merge($cache, $options[$option_name]);
    // If command-specific options were set and if we already have
    // a command, then apply the command-specific options immediately.
    if ($has_command_specific) {