Reads and parses configuration file Initializes the configuration, reloading all data
975509
public synchronized static void initConfig() {
        SeLionLogger.getLogger().entering();
        Map<ConfigProperty, String> initialValues = new HashMap<>();

        initConfig(initialValues);

        SeLionLogger.getLogger().exiting();
    }
114991
private void readConfigFile() {

        m_isValid = false;
        if ((null != m_configFile) && m_configFile.exists()) {
            if (m_configFile.canRead()) {
                Properties props = new Properties();
                try (FileInputStream input = new FileInputStream(m_configFile)) {
                    props.load(input);
                    for (Entry<Object, Object> entry : props.entrySet()) {
                        String key = (String)entry.getKey();
                        String propValue = (String)entry.getValue();
                        if (key.equals(DEFAULT_MODULES_TO_EXPORT)) {
                            String value = getValueFromProp(propValue).trim();
                            if (value.contains(",")) {
                                m_configuredModules = Arrays.asList(value.split(" *, *"));
                            } else {
                                m_configuredModules = Arrays.asList(value.split(" +"));
                            }
                        }

                        if (key.equals(DEFAULT_MODULE_PATH)) {
                            m_modulesPath = getValueFromProp(propValue).trim();
                        }

                        if (key.equals(DEFAULT_MODULE_RESOURCES_SUBFOLDER)) {
                            m_resourcesSubfolder = getValueFromProp(propValue).trim();
                        }

                        if (key.equals(DEFAULT_PULL_MODE_BEFORE)) {
                            String value = getValueFromProp(propValue);
                            value = value.trim();
                            if (value.equals("1")) {
                                m_defaultPullModeBefore = true;
                            }
                        }
                        if (key.equals(DEFAULT_PULL_MODE_AFTER)) {
                            String value = getValueFromProp(propValue);
                            value = value.trim();
                            if (value.equals("1")) {
                                m_defaultPullModeAfter = true;
                            }
                        }
                        if (key.equals(DEFAULT_PUSH_MODE)) {
                            String value = getValueFromProp(propValue);
                            value = value.trim();
                            if (value.equals("1")) {
                                m_defaultPushMode = true;
                            }
                        }
                        if (key.equals(DEFAULT_MODULE_EXPORT_PATH)) {
                            String value = getValueFromProp(propValue);
                            m_defaultModuleExportPath = value.trim();
                        }
                        if (key.equals(DEFAULT_REPOSITORY_PATH)) {
                            String value = getValueFromProp(propValue);
                            m_repositoryPath = value.trim();
                        }
                        if (key.equals(DEFAULT_EXPORT_MODE)) {
                            String value = getValueFromProp(propValue);
                            m_defaultExportMode = (value.trim().equals("1")) ? 1 : 0;
                        }
                        if (key.equals(DEFAULT_COMMIT_MESSAGE)) {
                            String value = getValueFromProp(propValue);
                            m_defaultCommitMessage = value;
                        }
                        if (key.equals(DEFAULT_GIT_USER_NAME)) {
                            String value = getValueFromProp(propValue);
                            m_defaultGitUserName = value;
                        }
                        if (key.equals(DEFAULT_GIT_USER_EMAIL)) {
                            String value = getValueFromProp(propValue);
                            m_defaultGitUserEmail = value;
                        }
                        if (key.equals(DEFAULT_EXCLUDE_LIBS)) {
                            String value = getValueFromProp(propValue);
                            m_defaultExcludeLibs = (value.trim().equals("1")) ? true : false;
                        }
                        if (key.equals(DEFAULT_COMMIT_MODE)) {
                            String value = getValueFromProp(propValue);
                            m_defaultCommitMode = (value.trim().equals("1")) ? true : false;
                        }
                        if (key.equals(DEFAULT_IGNORE_UNCLEAN)) {
                            String value = getValueFromProp(propValue);
                            m_defaultIgnoreUnclean = (value.trim().equals("1")) ? true : false;
                        }
                        if (key.equals(DEFAULT_COPY_AND_UNZIP)) {
                            String value = getValueFromProp(propValue);
                            m_defaultCopyAndUnzip = (value.trim().equals("1")) ? true : false;
                        }
                    }
                    m_isValid = true;
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
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');
            }
        }
    }
1356530
def init(filename=ConfigPath):
    """"""
    section, parts = "DEFAULT", filename.rsplit(":", 1)
    if len(parts) > 1 and os.path.isfile(parts[0]): filename, section = parts
    if not os.path.isfile(filename): return

    vardict, parser = globals(), configparser.RawConfigParser()
    parser.optionxform = str # Force case-sensitivity on names
    try:
        def parse_value(raw):
            try: return json.loads(raw) # Try to interpret as JSON
            except ValueError: return raw # JSON failed, fall back to raw
        txt = open(filename).read() # Add DEFAULT section if none present
        if not re.search("\\[\\w+\\]", txt): txt = "[DEFAULT]\n" + txt
        parser.readfp(StringIO.StringIO(txt), filename)
        for k, v in parser.items(section): vardict[k] = parse_value(v)
    except Exception:
        logging.warn("Error reading config from %s.", filename, exc_info=True)
569786
def parser(input_file_path='config.json'):
    '''
    
    '''

    # --- Read .json file
    try:
        with open(input_file_path, 'r') as config_file:
            config_new = json.load(config_file)
            config_file.close()
    except:
        raise Exception('Config file "'+input_file_path+'" not loaded properly. Please check it an try again.')

    import copy
    options = update_config(config_new, copy.deepcopy(default_config))

    return options
1223023
def read_conf_file
      conf = {}
      if File.exists?(CONF_PATH) && File.size?(CONF_PATH)
        # Store valid conf keys
        YAML.load_file(CONF_PATH).each do |key, value|
          if VALID_KEYS.include? key
            conf[key] = value
          else
            say "Invalid configuration key: #{key}"
          end
        end
      end
      conf
    end
90417
public static synchronized void init(Configuration conf) {
    if (!initDone) {
      DefaultConfiguration.conf = conf;
      DefaultConfiguration.initDone = true;
    }
  }
1339275
protected synchronized void readFile() {
        if (realmFile != null && realmFile.exists() && (realmFile.lastModified() != lastModified)) {
            lastModified = realmFile.lastModified();
            try {
                Preconditions.checkArgument(realmFile.canRead(), "The file '{}' can not be read!", realmFile);
                Config config = ConfigFactory.parseFile(realmFile);
                super.setup(config);
            } catch (Exception e) {
                log.error("Failed to read {}", realmFile, e);
            }
        }
    }
1022609
function read_config(path) {
	debug.assert(path).is('string');
	return FS.exists(path).then(function read_file(exists) {
		if(!exists) {
			return {};
		}
		return FS.readFile(path, {'encoding':'utf8'}).then(function parse_json(data) {
			debug.assert(data).is('string');
			return JSON.parse(data);
		});
	}).then(function init_config(config) {
		debug.assert(config).is('object');

		if(config.applications === undefined) {
			config.applications = {};
		}

		return config;
	});
}
1031536
function _load() {
  if (!existsSync(exports.configFile)) {
    _initFile();
  }

  try {
    return JSON.parse(fs.readFileSync(exports.configFile, 'utf8'));
  }
  catch (e) {
    console.error('JSON parse error');
    console.error('See and edit', exports.configFile);
    console.error('or exec `confy clean`');
    process.exit();
  }
}
1013648
private final function loadConfig(): void
    {
        $this->config = new Config();

        $file = sprintf('%s/app/service/%s/config/config.php', APP_DIR, $this->name);
        if (file_exists($file) && is_array($data = include $file)) {
            $this->config->setData($data);
        }
    }
1058126
function loadConfiguration () {
    if (!fs.existsSync(CONFIG_FILE)) {
        winston.info('No previous configuration found, creating one');
        fs.writeFileSync(CONFIG_FILE, fs.readFileSync(SAMPLE_FILE));
    }

    return yaml.safeLoad(fs.readFileSync(CONFIG_FILE));
}
38997
def reread(self):
        
        logger.debug("Loading settings from %s",
                     os.path.abspath(self.filename))
        conf = self.read_conf()
        changed = self.creds.reread()
        checks = self.parser.parse_checks(conf)
        if self.checks != checks:
            self.checks = checks
            return True
        else:
            return changed
941086
def __parse(self, configuration):
        
        for entry in (
            "properties",
            "environment",
            "paths",
            "bundles",
            "components",
        ):
            # Check if current values must be reset
            reset_key = "reset_{0}".format(entry)

            # Compute the name of the method
            call_name = "add" if not configuration.get(reset_key) else "set"
            method = getattr(self.__state, "{0}_{1}".format(call_name, entry))

            # Update configuration
            method(configuration.get(entry))
431344
public void loadConfiguration() {
		System.out.println("CONFIGURATION_DIR: " + CONFIGURATION_DIR);
		File f = new File(CONFIGURATION_DIR);

		if (f.isDirectory()) {
			String[] files = f.list();
			for (String s : files) {
				if (s.endsWith(".json")) {
					System.out.println("Registering: " + s.toLowerCase());
					this.registerServiceConfiguration(s.split(".json")[0], s);
				}
			}
		}
	}
1051763
def parsed_file(config_file):
    """"""
    parser = ConfigParser(allow_no_value=True)
    parser.readfp(config_file)
    return parser
444213
def read_config_file(file)
      file = File.expand_path(file)
      next_config = safe_load_file(file)
      check_config_is_hash!(next_config, file)
      Jekyll.logger.info "Configuration file:", file
      next_config
    rescue SystemCallError
      if @default_config_file ||= nil
        Jekyll.logger.warn "Configuration file:", "none"
        {}
      else
        Jekyll.logger.error "Fatal:", "The configuration file '#{file}'
          could not be found."
        raise LoadError, "The Configuration file '#{file}' could not be found."
      end
    end