Returns the configuration.

@param string|null $key The optional configuration key.

@return array The requested configuration.
430669
protected function getConfiguration($key = null)
    {
        return $key ? static::$config[$this->getProtocol()][$key] : static::$config[$this->getProtocol()];
    }
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;
    }
389964
public function get($key = null, $default = null)
    {
        if (!isset($key)) {
            return $this->config;
        }

        if (array_key_exists($key, $this->config)) {
            return $this->config[$key];
        }

        return $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;
    }
1258453
private function getSetting($key)
    {
        $settings = $this->settingsHelper->getSettings('general');

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

        return null;
    }
105216
static public function get($key = null, $default = null) {
        if (is_null($key)) return json_decode(json_encode(self::$_config));
        
        $config = &self::$_config;
        
        return Utils::arrayGet($config, $key, $default);
    }
1357766
private function getConfig($key)
    {
        if (!array_key_exists($key, $this->instConfig))
            return null;
        else
            return $this->instConfig[$key];
    }
818063
public function getConfig($key = null) {
		$results = $this->_getConfig($key);
		if (empty($results)) {
			return $results;
		}

		$event = new CakeEvent('Model.afterFind', $this, [$results, true, $key]);
		$event->modParams = 0;
		$this->getEventManager()->dispatch($event);

		return $event->result;
	}
1322257
public function get(string $key)
    {
        $hash =  self::findFirst([
            'conditions' => "{$this->settingsKey} = ?0 and key = ?1",
            'bind' => [$this->getSettingsKey(), $key]
        ]);

        if ($hash) {
            return $hash->value;
        }

        return 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;
	}
26964
public function configHierarchical($key = null)
    {
        $config = [];
        $all = $this->config($key);
        if (! is_array($all)) $all = array($key => $all);
        foreach ($all as $_key => $_val) {
            $keys = explode('.', $_key);
            $value = &$config;
            while ($key = array_shift($keys)) {
                if ($keys) {
                    if (! isset($value[$key])) $value[$key] = [];
                    $value = &$value[$key];
                } else {
                    $value[$key] = $_val;
                }
            }
        }
        return $config;
    }
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;
    }
111532
public function getConfig($key)
    {
        $key = $this->getClient()->run($this, 'config ' . $key);

        return trim($key);
    }
1119808
public function get(string $key = null)
    {
        $result = (null !== $key)
            ? $this->_config[$key] ?? null
            : $this->_config;

        return $result;
    }
823181
public function getConfig($key)
    {
        return isset($this->config[$key])
        ? $this->config[$key]
        : false;
    }
812725
public function config(string $key = null, $default = null)
    {
        $key = $key ? sprintf('%s.%s', $this->getId(), $key) : $this->getId();

        return config($key, $default);
    }
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;
    }