function drush_load_config_file

8.0.x context.inc drush_load_config_file($context, $config_list)
6.x context.inc drush_load_config_file($context, $config_list)
7.x context.inc drush_load_config_file($context, $config_list)
3.x context.inc drush_load_config_file($context, $config)
4.x context.inc drush_load_config_file($context, $config)
5.x context.inc drush_load_config_file($context, $config_list)
master context.inc drush_load_config_file($context, $config_list)
2 calls to drush_load_config_file()
drush_load_config in includes/context.inc
Load drushrc files (if available) from several possible locations.
_drush_sitealias_get_record in includes/sitealias.inc

File

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

Code

function drush_load_config_file($context, $config) {
  if (file_exists($config)) {
    $options = $aliases = $command_specific = $override = array();
    drush_log(dt('Loading drushrc "!config" into "!context" scope.', array('!config' => realpath($config), '!context' => $context)), 'bootstrap');
    $ret = @include_once($config);
    if ($ret === FALSE) {
      drush_log(dt('Cannot open drushrc "!config", ignoring.', array('!config' => realpath($config))), 'warning');
      return FALSE;
    }
    if (!empty($options) || !empty($aliases) || !empty($command_specific)) {
      $options = array_merge(drush_get_context($context), $options);
      $options['config-file'] = realpath($config);

      //$options['site-aliases'] = array_merge(isset($aliases) ? $aliases : array(), isset($options['site-aliases']) ? $options['site-aliases'] : array());
      unset($options['site-aliases']);
      $options['command-specific'] = array_merge(isset($command_specific) ? $command_specific : array(), isset($options['command-specific']) ? $options['command-specific'] : array());

      drush_set_config_options($context, $options, $override);
    }
  }
}