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
This is a continuation of drush_sitealias_get_record, above. It is not intended to be called directly.

File

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

Code

function drush_load_config_file($context, $config_list) {
  foreach ((array) $config_list as $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)), LogLevel::BOOTSTRAP);
      $ret = @include_once($config);
      if ($ret === FALSE) {
        drush_log(dt('Cannot open drushrc "!config", ignoring.', array('!config' => realpath($config))), LogLevel::WARNING);
        return FALSE;
      }
      if (!empty($options) || !empty($aliases) || !empty($command_specific) || !empty($override)) {
        $options = array_merge(drush_get_context($context), $options);
        $options['config-file'] = realpath($config);

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