Reads the input of the configuration file and parses the into the
ConfigSettings object.

@return ConfigSettings
768993
public ConfigSettings read()
	{

		ConfigSettings config = new ConfigSettings(ConfigEnum.IMPORT);

		String name;
		Node node;
		NodeList list = root.getChildNodes();

		int length = list.getLength();
		for (int i = 0; i < length; i++) {
			node = list.item(i);

			name = node.getNodeName().toUpperCase();

			if (name.equals(SECTION_MODE)) {
				parseModeConfig(node, config);
			}
			else if (name.equals(SECTION_EXTERNALS)) {
				parseExternalsConfig(node, config);
			}
			else if (name.equals(SECTION_INPUT)) {
				parseInputConfig(node, config);
			}
			else if (name.equals(SECTION_OUTPUT)) {
				parseOutputConfig(node, config);
			}
			else if (name.equals(SECTION_CACHE)) {
				parseCacheConfig(node, config);
			}
			else if (name.equals(SECTION_LOGGING)) {
				parseLoggingConfig(node, config);
			}
			else if (name.equals(SECTION_DEBUG)) {
				parseDebugConfig(node, config);
			}
			else if (name.equals(SECTION_FILTER)) {
				parseFilterConfig(node, config);
			}
		}

		return config;
	}
449429
def _read_config(cls):
        

        cls._config_parser = configparser.ConfigParser()
        cls._config_parser.read(cls._default_attribute_values_configuration_file_path)
1116453
private static function convertConfigsToFile(): string
    {
        $content = '';
        $separator = self::$separator;

        /* Convert array to strings */
        foreach (self::$configs as $configName => $configValue) {
            $content .= $configName . $separator . $configValue . "\n";
        }

        return $content;
    }
694747
public function getFiles()
    {

        // initialize the array with the files
        $files = array();

        // iterate over the file keys and read the configuration values
        foreach (FileKeys::getServerFileKeys() as $fileKey) {
            $files[$fileKey] = $this->getSystemConfiguration()->getParam($fileKey);
        }

        // return the array with the files
        return $files;
    }
986950
private void init() throws ConfigFileIOException {
        this.props = new Properties();
        log.info("Reading config file: {}", this.configFile);
        boolean ok = true;
        try {
            // El fichero esta en el CLASSPATH
            this.props.load(SystemConfig.class.getResourceAsStream(this.configFile));
        } catch (Exception e) {
            log.warn("File not found in the Classpath");
            try {
                this.props.load(new FileInputStream(this.configFile));
            } catch (IOException ioe) {
                log.error("Can't open file: {}", ioe.getLocalizedMessage());
                ok = false;
                ioe.printStackTrace();
                throw new ConfigFileIOException(ioe.getLocalizedMessage());
            }
        }
        if (ok) {
            log.info("Configuration loaded successfully");
            if (log.isDebugEnabled()) {
                log.debug(this.toString());
            }
        }
    }
117896
private function readConfigFile()
    {
        // reading the config file to be stored in the 'configurations' variable below
        $configurations = $this->config_reader->get('api');
        $this->mappers_base_namespace = $configurations['mappers'];
        $this->limit = $configurations['limit'];
    }
27032
protected function getConfig()
    {
        if ($this->config !== null) {
            return $this->config;
        }

        $this->config = $this->getDefaultConfig();

        $app = $this->getContainer();

        $file = $app['filesystem']->getFile(strtolower("extensions_config://{$this->getName()}.{$this->getVendor()}.yml"));

        if (!$file->exists()) {
            try {
                $this->copyDistFile($file);
            } catch (RuntimeException $e) {
                return $this->config;
            }
        }

        $this->addConfig($file);

        $localFile = $file->getParent()->getFile($file->getFilename('.yml') . '_local.yml');
        if ($localFile->exists()) {
            $this->addConfig($localFile);
        }

        return $this->config;
    }
224877
public Configuration getConfiguration() {
		final Configuration conf = new Configuration();
		for (Map.Entry<String, String> entry : data.entrySet()) {
			conf.setString(entry.getKey(), entry.getValue());
		}
		return conf;
	}
473625
public function readAllConfig()
    {
        // If configuration files are not there - will silently ignore
        foreach ($this->config_files as $file) {
            $this->readConfig($file);
        }

        $tz = $this->getConfig('timezone', null);
        if (!is_null($tz) && function_exists('date_default_timezone_set')) {
            // with seting default timezone
            date_default_timezone_set($tz);
        } else {
            if (!ini_get('date.timezone')) {
                ini_set('date.timezone', 'UTC');
            }
        }
    }
453627
protected function readConfig() {
    $this->configPath = $this->ensurePath($this->configPath);

    $config = file_get_contents($this->configPath);
    return Yaml::decode($config);
  }
404047
private void readPropertiesFiles() {

        if (this.configurationFileWildcard.isEmpty() || this.configurationFileExtension.isEmpty()) {
            // Skip configuration loading
            LOGGER.log(SKIP_CONF_LOADING);

        } else {
            // Assemble the regex pattern
            final Pattern filePattern = Pattern.compile(this.configurationFileWildcard + "\\." + this.configurationFileExtension);

            // Retrieve all resources from default classpath
            final Collection<String> list = ClasspathUtility.getClasspathResources(filePattern);

            LOGGER.log(CONFIG_FOUND, list.size(), list.size() > 1 ? "s" : "");

            for (final String confFilename : list) {
                readPropertiesFile(confFilename);
            }
        }
    }
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;
    }
346963
public function get_setting() {
        $result = $this->config_read($this->name);
        if (is_null($result)) {
            return NULL;
        }
        if (!$this->load_choices()) {
            return NULL;
        }
        $result = str_pad($result, count($this->choices), '0');
        $result = preg_split('//', $result, -1, PREG_SPLIT_NO_EMPTY);
        $setting = array();
        foreach ($this->choices as $key=>$unused) {
            $value = array_shift($result);
            if ($value) {
                $setting[$key] = 1;
            }
        }
        return $setting;
    }
533251
protected function readConfigs()
    {
        $configs = include getcwd().'/config.php';

        if (
            $this->environment != 'default' &&
            $this->filesystem->exists(getcwd().'/'.$fileName = "config-{$this->environment}.php")
        ) {
            $configs = array_merge($configs, include getcwd().'/'.$fileName);
        }

        $this->configs = array_merge($configs, (array) $this->configs);
    }
567373
protected function getSettingsInstance()
    {
        if (isset($this->settings)) {
            return $this->settings;
        }

        $settingsConfig = $this->getSettingsConfig();

        return $this->settings = new Settings($settingsConfig, $this);
    }
148759
@SuppressWarnings("unchecked")
    @Override
    public T readConfig(InputStream fileAsStream) throws ConfigurationException {
        InputStreamReader streamReader = new InputStreamReader(fileAsStream);
        try {
            YamlReader reader = new YamlReader(streamReader);
            reader.getConfig().setClassTag(clazz.getSimpleName(), clazz);
            return (T) reader.read();
        } catch (YamlException e) {
            throw new ConfigurationException("Configuration Exception", "CONF_002", e);
        }
    }
950999
protected function parseGeneral()
    {
        // Read the config and merge it. (note: We use temp variables to prevent
        // "Only variables should be passed by reference")
        $tempconfig = $this->parseConfigYaml('config.yml');
        $tempconfiglocal = $this->parseConfigYaml('config_local.yml');
        $general = Arr::replaceRecursive($tempconfig, $tempconfiglocal);

        // Merge the array with the defaults. Setting the required values that aren't already set.
        $general = Arr::replaceRecursive($this->defaultConfig, $general);

        if (isset($general['accept_file_types']) === true) {
            if (is_array($general['accept_file_types']) === false) {
                // Make sure old settings for 'accept_file_types' are not still picked up. Before 1.5.4 we used to store them
                // as a regex-like string, and we switched to an array. If we find the old style, fall back to the defaults.
                unset($general['accept_file_types']);
            }

            // To remove unacceptable / unwanted extensions from the list of Acceptable File Types
            $removeFromAllowedFileTypes = explode('|', 'sh|asp|cgi|php|php3|ph3|php4|ph4|php5|ph5|phtm|phtml');

            // Create a bag with lowercased extensions
            $bag = Bag::from($general['accept_file_types']);
            $bag = $bag->map(function ($key, $ext) use ($removeFromAllowedFileTypes) {
                if (!in_array(mb_strtolower($ext), $removeFromAllowedFileTypes)) {
                    return mb_strtolower($ext);
                } else {
                    return null;
                }
            })->clean();

            $general['accept_file_types'] = array_values($bag->toArray());
        }

        // Make sure Bolt's mount point is OK:
        $general['branding']['path'] = '/' . Str::makeSafe($general['branding']['path']);

        // Set the link in branding, if provided_by is set.
        $general['branding']['provided_link'] = Html::providerLink(
            $general['branding']['provided_by']
        );

        $general['database'] = $this->parseDatabase($general['database']);

        return $general;
    }