Return configuration value by key

@param string $configKey The identifier to read configuration
of application.
@return array Configuration value
1933
protected function _getConfigValueArray($configKey = null) {
		$result = [];
		if (empty($configKey)) {
			return $result;
		}

		$configPath = 'CakeInstaller.' . $configKey;
		if (!Configure::check($configPath)) {
			return $result;
		}

		$configValue = (array)Configure::read($configPath);
		if (!empty($configValue)) {
			$result = $configValue;
		}

		return $result;
	}
457649
public function getConfig(?string $key = null, ?string $subKey = null)
    {
        if ($key === null) {
            return $this->config;
        }
        $key = (string) $key;
        $subKey = $subKey === null ? null : (string) $subKey;
        if (array_key_exists($key, $this->config)) {
            if ($subKey !== null) {
                return array_key_exists($subKey, $this->config[$key]) 
                    ? $this->config[$key][$subKey] 
                    : null;
            }
            return $this->config[$key];
        }
        return null;
    }
713533
public function getConfig($key) {
    if (isset($this->config[$key])) {
      return $this->config[$key];
    }
    return FALSE;
  }
287102
public function loadToConfig($path, $configKey)
    {
        $loaded = $this->cleanArrayKeysRecursive(
            $this->file->isYamlFile($path)
                ? $this->loadFile($path)
                : $this->loadFromDirectory($path)
        );

        return $this->resolver->findAndReplaceExecutableCodeToExhaustion($loaded, $configKey);
    }
988015
public static function read($key)
    {
        // Check key existence
        if (!self::check($key)) {
            throw new \Exception('Configuration key "' . $key . '" doesn\'t exists');
            return false;
        }
        // Get value of key
        return self::$configList[$key];
    }
586650
protected function getConfigValue($key)
    {
        list($output) = $this->getSystemService()->execute($this->_('git config --global --get %s', $key));

        return trim($output);
    }
27721
static function get($key, $default = null) {
    if (isset(Config::$values[$key])) {
      return Config::$values[$key];
    } else {
      if (Config::isEmpty()) {
        throw new ConfigException("Site configuration has not been initialised for '$key'");
      } else if ($default !== null) {
        return $default;
      } else {
        throw new ConfigException("No site configuration value found for '$key'");
      }
    }
  }
432488
public static function getConfig($key = null, $conn_name = self::DEFAULT_CONNECTION) {
        
        if( $key && is_null($conn_name) ) {
            
            //get key's value for each connection
            $conn_names = array_keys(static::$_config);
            $val_of_key_4_each_conn_name = array_column(static::$_config, $key);
            
            return array_combine($conn_names, $val_of_key_4_each_conn_name);
            
        } else if ( $key && !is_null($conn_name) && strlen($conn_name) > 0 ) {
            
            //get key's value for the specified connection
            return static::$_config[$conn_name][$key];
            
        } else if( !$key && is_null($conn_name) ) {
            
            //get all config values for all connections
            return static::$_config;
            
        } else {
            
            //get all config values for the specified connection
            return static::$_config[$conn_name];
        }
    }
414926
function &get_key($config_key)
	{
		list($file_name, $section_name, $var_name) = explode('/', $config_key, 3);
		$result = &$this->get($file_name, $section_name, $var_name);
		return $result;
	}
718434
public static function getAdapter(string $configKey = null): AbstractAdapter
    {
        $key = $configKey ?? static::getDefaultAdapterKey();

        if (!isset(static::$adapters[$key])) {
        	$config = static::getConfig()->get($key);

        	if ($config === null) {
        		throw new ConfigException("There is no \"{$key}\" key defined in database config");
	        }

            static::$adapters[$key] = static::resolve($config);
            static::$adapters[$key]->setConfigKey($key);
        }

        return static::$adapters[$key];
    }
684788
protected function collectDevServiceProviders($configKey)
    {
        // Get the Config key where devProviders are located.
        $devProvidersConfigLocation = Config::get($configKey);

        // Get Providers keys.
        $keys = is_string($devProvidersConfigLocation) ? [$devProvidersConfigLocation] : $devProvidersConfigLocation;

        // Return Dev Providers.
        return collect($keys)->transform(function ($location) {
            // Transform each Location key to the actual array
            // containing the Providers.
            return Config::get($location);
        })->reject(function ($arrayOfProviders) {
            // Remove all null values
            return is_null($arrayOfProviders);
        })->flatten()->unique()->values();
    }
484975
public function getConfig($key)
    {
        if (! $this->getServiceLocator()->has($this->getId().'/'.$key)) {
            return false;
        }

        try{
            $config =  $this->getServiceLocator()->get($this->getId().'/'.$key);
            if ($config instanceof ConfigurationService) {
                $config = $config->getConfig();
            }
        } catch(ServiceNotFoundException $e){
            $config = false;
        }
        return $config;
    }
111532
public function getConfig($key)
    {
        $key = $this->getClient()->run($this, 'config ' . $key);

        return trim($key);
    }
26189
public function getConfig($key) {
        return isset($this->_config[$key]) ? $this->_config[$key] : null;
    }
352957
public function getConfig($configKey, $store = null)
    {
        // if a value is given store, use it, even if it is null/false/empty string/whatever
        $store = count(func_get_args()) > 1 ? $store : $this->getStore();
        return $this->_getStoreConfigValue($configKey, $store, false);
    }
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;
    }
82372
public static function mergeConfig($key, $config)
    {
        $values = Hash::merge((array) Configure::read($key), $config);
        Configure::write($key, $values);

        return $values;
    }