Gets the value of a config variable.

@command blt:config:get

@aliases bcg config:get

@param string $key
The key for the configuration item to get.

@throws \Acquia\Blt\Robo\Exceptions\BltException
481115
public function getValue($key) {
    if (!$this->getConfig()->has($key)) {
      throw new BltException("$key is not set.");
    }

    $this->say($this->getConfigValue($key));
  }
692027
public function get($key)
	{
		$resolved = false;
		$value = $this->getByKey($key, $this->data, $resolved);
		
		if($resolved)
		{
			return $value;
		}
		
		if(func_num_args() > 1)
		{
			return func_get_arg(1);
		}
		
		throw new \OutOfBoundsException('Configuration setting not found: "' . $key . '"');
	}
380311
public static function get(string $key = null)
    {
        self::set();

        if (empty($key)) {
            return self::$config;
        }

        $keys  = explode('.', $key);
        $value = self::$config;

        foreach ($keys as $key) {
            if ( ! isset($value[$key])) {
                return null;
            }

            $value = $value[$key];
        }

        return $value;
    }
67839
public static function get($key)
    {
        self::getInstance();

        if (array_key_exists($key, self::$settings))
        {
            return self::$settings[$key];
        }

        throw new \InvalidArgumentException("The key $key doesn't exist in the Config Registry.");
    }
821646
public function get($key)
    {
        return isset($this->vars[$key]) ? $this->vars[$key] : false;
    }
91516
final public static function getConfig($key = null)
    {
        $calledClass = get_called_class();

        // Load config
        if (!isset(self::$loadedConfigSet[$calledClass]) || null === self::$loadedConfigSet[$calledClass]) {
            self::$loadedConfigSet[$calledClass] = array_merge(self::$configDefault, static::loadConfig());
        }

        // Get config property
        return (null === $key)
            ? self::$loadedConfigSet[$calledClass]
            : self::$loadedConfigSet[$calledClass][$key];
    }
1271847
public static function get($key = null)
    {
        if ($key) {
            $config = static::findBy(['key' => $key]);
            return $config ? $config->getValue() : '';
        } else {
            $config = [];
            foreach (static::all() as $c) {
                $config[$c->key] = $c->getValue();
            }
            return $config;
        }
    }
871985
public static function config($key)
    {
        $app = Strata::app();
        if (!is_null($app)) {
            return $app->getConfig($key);
        }
    }
737838
public function getConfig(string $key = null)
    {
        if ($key) {
            return $this->getValue($key);
        }

        return $this->config;
    }
776379
private static function getConfigValue($key, $config)
    {
        $config = ($config && is_array($config)) ? $config : BlockCypherConfigManager::getInstance()->getConfigHashmap();
        return (array_key_exists($key, $config)) ? trim($config[$key]) : null;
    }
430809
public function getConfiguration($key = null)
    {
        return isset($this->_args[ $key ]) ? $this->_args[ $key ] : null;
    }
716539
public function get($key)
    {
        $parts = explode('.', $key);
        $offset = $this->config;

        foreach($parts as $part) {
            if(!isset($offset[$part])) return null;

            $offset = $offset[$part];
        }

        return $offset;
    }
751984
public function get(string $key)
    {
        $result = null;
        if (isset($this->configuration[$key])) {
            $result = (string)$this->configuration[$key];
        } elseif (isset($GLOBALS['TSFE']->config['config']['tx_staticfilecache.'][$key])) {
            $result = (string)$GLOBALS['TSFE']->config['config']['tx_staticfilecache.'][$key];
        }

        return $result;
    }
836452
public function getVariable($key)
    {
        if (!isset($this->variables[$key])) {
            return null;
        }
        return $this->variables[$key];
    }
1218426
public function getkey($key, $cb = null)
    {
        $this->redis->get($this->config->redisprefix->value . $key, $cb);
    }
879712
public function getConfig($key)
    {
        if (null === $this->configs) {
            $this->loadConfigs();
        }

        if (false == array_key_exists($key, $this->configs)) {
            $availableKeys = implode(', ', array_keys($this->configs));
            throw new \RuntimeException(sprintf('Config "%s" could not be found. Found: %s', $key, $availableKeys));
        }

        $config = $this->configs[$key];

        return $config;
    }
807665
public static function getConfigured($key, $default = null)
    {
        $instance = static::instance();

        $value = $instance->get($key);

        $defaultValue = $instance->getDefaultValue($key);

        return $value != $defaultValue ? $value : $default;
    }