function drush_config_get_value

8.0.x config.drush.inc drush_config_get_value($config_name, $key)
7.x config.drush.inc drush_config_get_value($config_name, $key)
master config.drush.inc drush_config_get_value($config_name, $key)

Show and return a value from config system.

Parameters

$config_name: The config name.

$key: The config key.

1 call to drush_config_get_value()
drush_config_get in commands/core/config.drush.inc
Config get command callback.

File

commands/core/config.drush.inc, line 861
Provides Configuration Management commands.

Code

function drush_config_get_value($config_name, $key) {
  $config = Drupal::config($config_name);
  if ($config->isNew()) {
    return drush_set_error(dt('Config !name does not exist', array('!name' => $config_name)));
  }
  $value = $config->get($key);
  $returns[$config_name . ':' . $key] = $value;

  if ($value === NULL) {
    return drush_set_error('DRUSH_CONFIG_ERROR', dt('No matching key found in !name config.', array('!name' => $config_name)));
  }
  else {
    return $returns;
  }
}