Return the configuration.

@param string $key
@return mixed
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;
  }
1069236
private function getValue ($key)
    {
        return isset($this->configuration[$key])
            ? $this->configuration[$key]
            : null;
    }
579499
public function getConfig($key = null, $default = null)
    {

        $configurator = $this->getConfigurator();
        if (null === $key) {
            return $configurator;
        }

        return $configurator->get($key, $default);
    }
1094684
public static function get($key)
    {
        return isset(self::$config[$key]) ? self::$config[$key] : null;
    }
430669
protected function getConfiguration($key = null)
    {
        return $key ? static::$config[$this->getProtocol()][$key] : static::$config[$this->getProtocol()];
    }
998347
public function getConfig($key = null, $default = null)
    {
        $name = $this->current ?: 'default';

        $configs = $this->configs[$name];
        if ($key === null) {
            return $configs;
        }

        return isset($configs[$key]) ? $configs[$key] : $default;
    }
1240069
public function config($key = null, $default = null)
    {
        if ($key === null) {
            return $this->config;
        }

        return Arr::get($this->config, $key, $default);
    }
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;
	}
1119808
public function get(string $key = null)
    {
        $result = (null !== $key)
            ? $this->_config[$key] ?? null
            : $this->_config;

        return $result;
    }
941461
public function getConfig($key = null) {
		$configPath = 'CakeSettingsApp';
		if (!empty($key)) {
			$configPath .= '.' . $key;
		}

		$result = Configure::read($configPath);

		return $result;
	}
1233047
public function get($key)
    {
        if (isset($this->config[$key])) {
            // if true, 'config' is also always set
            return $this->config[$key]['config'];
        }

        $conf = null;
        $file = $this->getFileNameForKey($key);

        // check if in cache
        if (null !== $this->cache) {
            $cacheKey = $this->getCacheKeyForFile($file);
            $conf = $this->app[$this->cache]->get($cacheKey);
            if (false !== $conf) {
                $this->config[$key] = [
                    'config' => $conf,
                    'cacheKey' => $cacheKey,
                ];

                return $conf;
            }
        }

        // Load from file
        $conf = $this->loader->getConfig($file);
        $this->config[$key] = ['config' => $conf];

        // Store in the cache
        if (null !== $this->cache) {
            $this->config[$key]['cacheKey'] = $cacheKey;
            $this->app[$this->cache]->set($cacheKey, $conf);
        }

        return $conf;
    }
871985
public static function config($key)
    {
        $app = Strata::app();
        if (!is_null($app)) {
            return $app->getConfig($key);
        }
    }
519432
public function getConfig($key = null)
	{
		if (isLaravel5())
		{
			$configNameSpace = 'vendor.'.$this->packageVendor.'.'.$this->packageName.'.';
											//question ? result if true :(result is false)
			$key = $configNameSpace  . ($key ? '.'.$key : '');

			return $this->app['config']->get($key);
		}
	}
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;
	}
823181
public function getConfig($key)
    {
        return isset($this->config[$key])
        ? $this->config[$key]
        : false;
    }
490650
public static function getConfig($key = null, $default = null)
    {
        if (!is_null($key)) {
            if (false !== Util::path(static::$config, $key, $found)) {
                return $found;
            } else {
                return $default;
            }
        }

        return static::$config;
    }
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];
    }