Get the configs from any config file, fetched by config name. Config name is the name on file system,
so you can fetch Koldy's config files or your own configs.

@param string $name
@param bool $isPointerConfig

@return Config
@throws Exception
330309
public static function getConfig(string $name, bool $isPointerConfig = false): Config
    {
        if (isset(static::$configs[$name])) {
            return static::$configs[$name];
        }

	    // otherwise, lookup for config on file system
	    $applicationConfig = static::$configs['application'] ?? null;

	    if ($applicationConfig === null) {
		    throw new ConfigException('The main "application" config is NOT passed to the web app so framework can\'t load other configs because it doesn\'t know where they are');
	    }

	    $configFiles = $applicationConfig->get('config', []);

        $config = new Config($name, $isPointerConfig);

        if (array_key_exists($name, $configFiles)) {
            $path = stream_resolve_include_path($configFiles[$name]);
        } else {
            $path = static::$configsPath . $name . '.php';
        }

        $config->loadFrom($path);
        static::$configs[$name] = $config;
        return $config;
    }
1222607
public function getConfigurator(string $name): FieldSetConfigurator
    {
        if (!isset($this->configurators[$name])) {
            if (isset($this->serviceIds[$name])) {
                $configurator = $this->container->get($this->serviceIds[$name]);
            } elseif (class_exists($name)) {
                // Support fully-qualified class names.
                $configurator = new $name();
            } else {
                throw new InvalidArgumentException(sprintf('Could not load FieldSet configurator "%s".', $name));
            }

            if (!$configurator instanceof FieldSetConfigurator) {
                throw new InvalidArgumentException(sprintf('Configurator class "%s" is expected to be an instance of '.FieldSetConfigurator::class, $name));
            }

            $this->configurators[$name] = $configurator;
        }

        return $this->configurators[$name];
    }
845568
public function getPayPalConfig()
    {
        if (!$this->payPalConfig) {
            /** @var \OxidEsales\PayPalModule\Core\Exception\PayPalMissingParameterException $exception */
            $exception = oxNew(\OxidEsales\PayPalModule\Core\Exception\PayPalMissingParameterException::class);
            throw $exception;
        }

        return $this->payPalConfig;
    }
1268781
protected function getConfig($name)
	{
		$config = $this->app['config']['remote.connections.'.$name];

		if ( ! is_null($config)) return $config;

		throw new \InvalidArgumentException("Remote connection [$name] not defined.");
	}
1049516
public function getConfig()
    {
        $conf = [];
        foreach (glob(__DIR__.'/../../config/*.config.php') as $conFile) {
            $conFile = include_once $conFile;
            if (is_array($conFile))
                $conf = \Poirot\Core\array_merge($conf, $conFile);
        }

        // usually return like this
        return $conf;
    }
421382
protected function createServiceConfig(string $name): array
    {
        $config = [];
        if ($this->has($name)) {
            $config = $this->config[$name];
        }

        $class = $name;

        if (isset($config['use'])) {
            if (!is_string($config['use'])) {
                throw new Exception\InvalidConfiguration('use must be a string for service '.$name);
            }

            $class = $config['use'] = $this->getEnv($config['use']);
        }

        if (preg_match('#^\{([^{}]+)\}$#', $class)) {
            $config = array_merge($this->getServiceDefaults(), $config);

            return $config;
        }

        $config = $this->mergeServiceConfig($name, $class, $config);

        if (isset($config['use'])) {
            $class = $config['use'] = $this->getEnv($config['use']);
        }

        if (!class_exists($class)) {
            throw new Exception\InvalidConfiguration('class '.$class.' is either not a class or can not be found');
        }

        return $config;
    }
1000099
public static function lookupByName($name)
    {
        if (empty($name)) {
            throw new \InvalidArgumentException('Argument "name" cannot be empty');
        }

        if (!isset(self::$methods_config[$name])) {
            throw new \InvalidArgumentException('Method "' . $name . '" doesn\'t exist');
        }

        return self::$methods_config[$name];
    }
754029
public function configure($what)
    {
        if (is_array($what)) {
            $options = $what;
        } elseif (is_readable($what)) {
            $options = include $what;
        } else {
            throw new Exception("Configure item '" . htmlentities($what)
                . "' is not an array nor a readable file.");
        }

        $this->config = array_merge($this->config, $options);
        return $this->config;
    }
980105
public function loadConfig()
    {
        $config = [];

        $configDir = $this->getConfigDir();
        $distConfigDir = $this->getDistConfigDir();

        foreach ($this->configKeys as $configKey) {
            $fullPath = $configDir.'/'.$configKey.'.yml';
            $fullDistPath = $distConfigDir.'/'.$configKey.'.yml';
            $config[$configKey] = [];

            $userConfig = [];
            if ($this->filesystem->exists($fullPath)) {
                $userConfig = Yaml::parse(file_get_contents($fullPath));
            }

            if ($this->filesystem->exists($fullDistPath)) {
                $distConfig = Yaml::parse(file_get_contents($fullDistPath));
            } else {
                throw new \RuntimeException(sprintf(
                    'Could not find dist config at path (%s)',
                    $fullDistPath
                ));
            }

            $config[$configKey] = new Config(array_merge(
                $distConfig,
                $userConfig
            ));
        }

        $this->cachedConfig = $config;

        return $config;
    }
123356
protected function loadConfig( string$name, IConfigProvider$configProvider )
	{
		$config= $configProvider->getConfig($this->nodeType.'_nodes',$name) ?: $configProvider->getConfig($this->nodeType.'_nodes','*');

		if( isset($config['multiple']) ){
			foreach( $config['multiple'] as $value ){
				if( $this->line->pregGet($value['pattern']) ){
					$config= $value;
					break;
				}
			}
		}

		if( isset($config['in']) ){
			$config=(function( array$config )use($name){
				foreach( $config['in'] as $key=>$value ){
					if( $this->document->scope && $this->document->scope->scope===$key ){
						$value['in_scope']= $key;
						return $value;
					}
				}
				if( !isset($config['out']) ){
					$this->document->throw("The $this->nodeType node $name only use in scope ".implode(',',array_keys($config['in'])));
				}
				return $config['out'];
			})($config);
		}elseif( isset($config['only_in']) && (!$this->document->scope || !in_array($this->document->scope->scope,$config['only_in'])) ){
			$this->document->throw("The $this->nodeType node $name only use in scope ".implode(',',$config['only_in']));
		}elseif( isset($config['not_in']) && (!$this->document->scope || !in_array($this->document->scope->scope,$config['not_in'])) ){
			$this->document->throw("The $this->nodeType node $name not use in scope ".implode(',',$config['not_in']));
		}

		if( !is_array($config) ){$this->document->throw("The $this->nodeType node $name is not supported.");}

		$this->config= $config;

		return $this;
	}
227474
public function getConfig($key = '')
    {
        $config = $this->getParam('config');
        if (empty($key)) {
            return $config;
        }

        if (!\array_key_exists($key, $config)) {
            throw new InvalidException('Config key is not set: '.$key);
        }

        return $config[$key];
    }
672759
public static function config($name)
    {
        self::load();
        if (!isset(self::$_config[$name])) {
            if (self::isBase64($name)) {
                $name = base64_decode($name);
            }
            throw new \Mix\Exception\ConfigException("Bean configuration not found: {$name}");
        }
        return self::$_config[$name];
    }
24075
protected function parseObjectField($isConst, &$fieldNames)
    {
        $start = $this->token->getStart();
        $name = $this->parseName();
        $value = $name->get('value');

        if (array_key_exists($value, $fieldNames)) {
            throw new \Exception(sprintf('Duplicate input object field %s.', $value));
        }

        $fieldNames[$value] = TRUE;
        $this->expect(Token::COLON_TYPE);

        return new ObjectField($name, $this->parseValue($isConst), $this->location($start));
    }
292501
public function getAppConfig (array $defaults = array()) {
		$config = $this -> loadConfigFile("config");

		if (!is_array($config)) {
			throw new Exception("Config file must return an array.");
		}

		$config = $this -> arrays -> deepMerge($defaults, $config);
		return new Tree($config, $this -> getAppConfigSchema());
	}
1018016
protected function getConfigHelper()
    {
        $config_file = $this->getConfigFile();

        if (!file_exists($config_file)) {
            throw new \Exception('Config file not found.');
        }

        return new \Illuminate\Config\Repository(array('elasticquent' => require($config_file)));
    }
1215766
public function get_config($name, $default = NULL) {
        $this->load_config();
        return isset($this->config->$name) ? $this->config->$name : $default;
    }
920215
public function getConfig($name) {
        $data = $this->get($name);
        if ($data === null) {
            return null;
        }
        if (isset($this->data['global'])) {
            $data['global'] = $this->data['global'];
        }
        $config = new self();
        $config->load($data);
        return $config;
    }