Returns all config items or a specific one

@param  null|mixed $key
@return mixed
328956
protected function getConfig($key = null)
    {
        if (!is_null($key)) {
            if (!array_key_exists($key, $this->config)) {
                throw new \InvalidArgumentException('Config key "'.$key.'" does not exist. Valid keys are: "'.implode(', ', array_keys($this->config)).'"');
            }

            return $this->config[$key];
        }

        return $this->config;
    }
1209784
public static function configGet($key)
    {
		$data = self::getDbConnection()->fetchAssoc('SELECT value FROM config WHERE `class` = ? and `key` = ?', array( get_called_class(), $key ));
		if (!$data) return null;
		return unserialize($data['value']);
    }
145367
public function getParams($key = null)
	{
		if(is_null($key))
		{
			return $this->params;
		}

		return $this->params[$key];
	}
1069236
private function getValue ($key)
    {
        return isset($this->configuration[$key])
            ? $this->configuration[$key]
            : null;
    }
1233067
public function get(string $key)
    {
        $key = strtolower($key);

        if (empty($this->configuration[$key])) {
            $this->loadConfigFile($key);
        }

        return $this->configuration[$key];
    }
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;
    }
1240069
public function config($key = null, $default = null)
    {
        if ($key === null) {
            return $this->config;
        }

        return Arr::get($this->config, $key, $default);
    }
823181
public function getConfig($key)
    {
        return isset($this->config[$key])
        ? $this->config[$key]
        : false;
    }
646730
public function getValueByKey($key)
    {
        $model = Configuration::whereConfigurationKey($key)->first();

        if (null === $model) {
            return null;
        }

        return $model->configuration_value;
    }
744694
protected function config(string $key)
    {
        $config = json_decode($this->header('config'), true);
        $definition = explode('.', $key);
        $item = isset($config[$definition[0]]) ? $config[$definition[0]] : null;

        $numberOfDefinitions = count($definition);

        for ($i = 1; $i < $numberOfDefinitions; ++$i) {
            $item = isset($item[$definition[$i]]) ? $item[$definition[$i]] : null;
        }

        return $item;
    }
77953
public function getConfig($key = null, $default = null)
	{
		if (is_array($key))
		{
			return \Arr::subset($this->config, $key, $default);
		}

		return \Arr::get($this->config, $key, $default);
	}
186531
public function getConfigVariable(string $key)
    {
        if ($key === '' || $key === null) {
            return null;
        }

        if (!isset($this->setting[$key])) {
            return null;
        }

        return $this->setting[$key];
    }
559321
public function get($key, $default = null)
    {
        list($namespace, $group, $item) = $this->parseKey($key);

        // Configuration items are actually keyed by "collection", which is simply a
        // combination of each namespace and groups, which allows a unique way to
        // identify the arrays of configuration items for the particular files.
        $collection = $this->getCollection($group, $namespace);

        $this->load($group, $namespace, $collection);

        return array_get($this->items[$collection], $item, $default);
    }
72469
protected function _configRead($key)
    {
        if ($key === null) {
            return $this->_config;
        }

        if (strpos($key, '.') === false) {
            return isset($this->_config[$key]) ? $this->_config[$key] : null;
        }

        $return = $this->_config;

        foreach (explode('.', $key) as $k) {
            if (!is_array($return) || !isset($return[$k])) {
                $return = null;
                break;
            }

            $return = $return[$k];
        }

        return $return;
    }
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;
    }
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;
    }
897158
public function loadByKey($key)
    {
        $configuration = new Configuration();
        require $key;
        $vars = get_defined_vars();
        unset($vars['configuration']);
        unset($vars['key']);
        foreach ($vars as $name => $value) {
            $configuration->{$name} = $value;
        }

        return $configuration;
    }