Return a config.

@param string $key

@return mixed
423014
public function getConfig($key)
    {
        if (!isset($this->config[$key])) {
            throw new \Exception(sprintf('No config found for key: "%s"', $key));
        }

        return $this->config[$key];
    }
1248433
public static function get( $key = null ) {
		$configs = self::$configs;
		if ( $key ) {
			$configs = ! empty( self::$configs[ $key ] ) ? self::$configs[ $key ] : null;
		} else {
			$configs = self::$configs;
		}

		return $configs;
	}
1167696
public function getConfigurationValue($key)
    {
        $configuration = $this->getConfiguration();

        $pathParts = explode(self::DELIMITER, $key);
        foreach ($pathParts as $pathPart) {
            if (isset($configuration[ucfirst($pathPart)]) === true) {
                $configuration = $configuration[ucfirst($pathPart)];
            } else {
                $configuration = null;
            }
        }

        return $configuration;
    }
121808
public static function getConfig($key = '')
    {
        if (empty($key)) {
            return self::$config;
        } else {
            $keys = str_replace('\\', '/', $key);
            $explodeKey = explode('/', $keys);
            if (array_key_exists($explodeKey[0], self::$config)) {
                if (isset($explodeKey[1]) && isset(self::$config[$explodeKey[0]][$explodeKey[1]])) {
                    if (isset($explodeKey[2]) && isset(self::$config[$explodeKey[0]][$explodeKey[1]][$explodeKey[2]])) {
                        if (isset($explodeKey[3]) && isset(self::$config[$explodeKey[0]][$explodeKey[1]][$explodeKey[2]][$explodeKey[3]])) {
                            if (isset($explodeKey[4]) && isset(self::$config[$explodeKey[0]][$explodeKey[1]][$explodeKey[2]][$explodeKey[3]][$explodeKey[4]])) {
                                if (isset($explodeKey[5]) && isset(self::$config[$explodeKey[0]][$explodeKey[1]][$explodeKey[2]][$explodeKey[3]][$explodeKey[4]][$explodeKey[5]])) {
                                    return self::$config[$explodeKey[0]][$explodeKey[1]][$explodeKey[2]][$explodeKey[3]][$explodeKey[4]][$explodeKey[5]];
                                } else {
                                    return self::$config[$explodeKey[0]][$explodeKey[1]][$explodeKey[2]][$explodeKey[3]][$explodeKey[4]];
                                }
                            } else {
                                return self::$config[$explodeKey[0]][$explodeKey[1]][$explodeKey[2]][$explodeKey[3]];
                            }
                        } else {
                            return self::$config[$explodeKey[0]][$explodeKey[1]][$explodeKey[2]];
                        }
                    } else {
                        return self::$config[$explodeKey[0]][$explodeKey[1]];
                    }
                } else {
                    return self::$config[$explodeKey[0]];
                }
            }
        }
    }
871985
public static function config($key)
    {
        $app = Strata::app();
        if (!is_null($app)) {
            return $app->getConfig($key);
        }
    }
738250
public function get(string $key)
    {
        return isset($this->_configValues[$key])
            ? $this->_configValues[$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;
	}
1240069
public function config($key = null, $default = null)
    {
        if ($key === null) {
            return $this->config;
        }

        return Arr::get($this->config, $key, $default);
    }
557441
private function get($key, $default = null)
    {
        if ( ! empty($this->config[$key])) {
            return $this->config[$key];
        }

        if (function_exists('config')) {
            if (null !== (config($key))) {
                return config($key);
            }
        }
        
        return $default;
    }
390291
public function get($key, $default = null)
    {
        $pieces = explode('.', $key);
        $config = $this->config;

        foreach ($pieces as $piece) {
            if (!isset($config[$piece])) {
                return $default;
            }

            $config = $config[$piece];
        }

        return $config;
    }
17052
public function getConfig($key)
  {
    if (empty($key)) {
      return '';
    }

    $keys  = explode('.', $key);
    $value = array();

    if (isset($this->config[$keys[0]])) {
      $value = $this->config[$keys[0]];
    }

    if (empty($value)) {
      return $value;
    }

    $totalKey = count($keys);

    if ($totalKey > 1) {
      for ($i = 1; $i < $totalKey; ++$i) {
        if (isset($value[$keys[$i]])) {
          $value = $value[$keys[$i]];
        }
      }
    }

    unset($keys);

    return $value;
  }
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;
        }
    }
463440
protected function fetchConfig($key)
	{
		$config = $this->config[ $key ];

		if (isset($this->configOverride[ $this->renderMode ][ $key ])) {
			$override = $this->configOverride[ $this->renderMode ][ $key ];
			$config = array_merge($config, $override);
		}

		return $config;
	}
891856
public function get_config($key = null, $default = null) {
        if ($this->config === null) {
            $this->config = (object) array();
        }
        if ($key === null) {
            return $this->config;
        }

        if (property_exists($this->config, $key)) {
            return $this->config->$key;
        }

        if ($default !== null) {
            return $default;
        }

        return configuration::get_default_value($key);
    }
416849
protected function getConfig($key, $default = null)
    {
        $config = $this->getApp()->make('config');

        return $config->get($key, $default);
    }
604645
public static function getConfig($key)
    {
        return isset(self::$connectionConfig[$key]) ? self::$connectionConfig[$key] : null;
    }
239708
public function getConfig(string $key, ?Configuration $default = null): Configuration
    {
        $resolved = false;
        $value = $this->getByKey($key, $this->data, $resolved);
        
        if ($resolved) {
            return new static($value);
        }
        
        return $default ?? new static();
    }