function drush_config_get_value

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

Show and return a value from config system.


$config_name: The config name.

$key: The config key.

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


commands/core/, line 1306
Provides Configuration Management commands.


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;