Get a configuration key.

@param $key

@throws \Exception

@return mixed
439949
protected function config($key = null, $default = null)
    {
        if (is_null($key)) {
            return app('tddd.config');
        }

        return ConfigFacade::get($key, $default);
    }
1168819
public static function getConfiguredUrl($key)
    {
        if (empty(self::$urlOptions[$key])) {
            throw new Exception("Invalid key $key");
        }
        $url = Option::get(self::$urlOptions[$key]);
        return $url;
    }
430809
public function getConfiguration($key = null)
    {
        return isset($this->_args[ $key ]) ? $this->_args[ $key ] : null;
    }
1171240
protected function _getConfig($key = null) {
		$language = Configure::read('Config.language');
		$key = (string)$key;

		if ($key === 'Language') {
			if (empty($language)) {
				return null;
			}

			$configs = $language;
		} else {
			$configPath = $this->_modelConfigSettingsApp->getNameConfigKey();
			if (!empty($key)) {
				$configPath .= '.' . $key;
			}

			$configs = Configure::read($configPath);
			if ($configs === null) {
				return null;
			}

			if (empty($key)) {
				$configs['Language'] = $language;
			}
		}

		if (!empty($key)) {
			$configs = [$key => $configs];
		}

		$listSerializedFields = $this->_modelConfigSettingsApp->getListSerializeFields();
		$result = [];
		foreach ($configs as $configName => $configValue) {
			switch ($configName) {
				case 'EmailSmtppassword':
					if (!empty($configValue)) {
						$result[$this->alias][$configName] = Security::decrypt(base64_decode($configValue), Configure::read('Security.key'));
					} else {
						$result[$this->alias][$configName] = $configValue;
					}
					break;
				default:
					if (in_array($configName, $listSerializedFields) && !empty($configValue)) {
						$configValue = unserialize($configValue);
					}
					$result[$this->alias][$configName] = $configValue;
			}
		}

		if (!empty($key)) {
			return Hash::get($result, $this->alias . '.' . $key);
		}

		if (empty($result)) {
			return null;
		}

		return $result;
	}
388649
public function get( $key )
	{
		if( empty( $key ) )																		//  no Key given
			throw new InvalidArgumentException( 'Key must not be empty.' );						//  throw Exception
		if( isset( $this->pairs[$key] ) )														//  Key is set on its own
			return $this->pairs[$key];															//  return Value
		else																					//  Key has not been found
		{
			$key		.= ".";																	//  prepare Prefix Key to seach for
			$list		= array();																//  define empty Map
			$length		= strlen( $key );														//  get Length of Prefix Key outside the Loop
			foreach( $this->pairs as $pairKey => $pairValue )									//  iterate all stores Pairs
			{
				if( $pairKey[0] !== $key[0] )													//  precheck for Performance
				{
					if( count( $list ) )														//  Pairs with Prefix Keys are passed
						return $list;															//  break Loop -> big Performance Boost
					continue;																	//  skip Pair
				}
				if( strpos( $pairKey, $key ) === 0 )											//  Prefix Key is found
					$list[substr( $pairKey, $length )]	= $pairValue;							//  collect Pair
			}
			if( count( $list ) )																//  found Pairs
				return $list;																	//  return Pair Map
		}
		return NULL;																			//  nothing found
	}
1068964
public function get($key)
    {
        if (array_key_exists($key, $this->settings)) {
            return $this->settings[$key];
        }

        return false;
    }
147759
public function get(string $key): string
    {
        if (!$this->users_id) {
            throw new Exception('No users is set to save config');
        }

        if ($config = $this->findFirst(['conditions' => 'users_id = ?0 and name = ?1', 'bind' => [$this->users_id, $key]])) {
            return $config->value;
        }

        throw new Exception('No value found for key: ' . $key);
    }
1148391
public function get($key)
    {
        $ret = $this->traverseTree($key);
        if(!is_scalar($ret))
        {
            throw new UnexpectedValueException("The {$key} configuration value is not scalar");
        }
        return $ret;
    }
215158
protected function requireOption($key)
    {
        $value = $this->option($key);
        if ($value === null) {
            throw new Exception("The '{$key}' option is required.");
        }

        return $value;
    }
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;
    }
874484
public function get(string $key, bool $throwException = true)
    {
        if (!array_key_exists($key, $this->configData)) {
            if ($throwException) {
                throw new \InvalidArgumentException("Key \"{$key}\" not found in configuration with name \"{$this->instanceName}\"");
            }
            return null;
        }
        return $this->configData[$key];
    }
823181
public function getConfig($key)
    {
        return isset($this->config[$key])
        ? $this->config[$key]
        : false;
    }
1357766
private function getConfig($key)
    {
        if (!array_key_exists($key, $this->instConfig))
            return null;
        else
            return $this->instConfig[$key];
    }
1027348
public function get($key)
    {
        if (isset($this->conf[$key])) {
            return (string) $this->conf[$key];
        }

        return null;
    }
685757
protected function getConfigInstance($key)
    {
        $instance = $this->config($key);

        if (is_string($instance)) {
            return $this->app->make($instance);
        }

        return $instance;
    }
862874
final protected function getConfigValue(string $key)
    {
        $retval = false;

        if (isset($this->config[$key], $this->config[$key][ConfigurationInterface::KEY_VALUE])) {
            $retval = $this->config[$key][ConfigurationInterface::KEY_VALUE];
        } elseif (isset($this->config[$key])) {
            $retval = $this->config[$key];
        }

        return $retval;
    }
604645
public static function getConfig($key)
    {
        return isset(self::$connectionConfig[$key]) ? self::$connectionConfig[$key] : null;
    }