Read configuration file.
194261
public function readConfig() {
		$file = $this->path->getConfigPath() . '/database.php';
		if (file_exists($file)) {
			$config = require($file);
			$this->defaultConfigName = $config['default'];
			$this->connectionConfigs = $config['connections'];
		}
	}
1128325
def parse_config(config_file):
    """"""
    try:
        with open(config_file, 'r') as f:
            return yaml.load(f)
    except IOError:
        print "Configuration file {} not found or not readable.".format(config_file)
        raise
932321
def get_config_file():
    # type: () -> AnyStr
    """"""
    parser = argparse.ArgumentParser(description="Read configuration file.")
    parser.add_argument('-ini', help="Full path of configuration file")
    args = parser.parse_args()
    ini_file = args.ini
    if not FileClass.is_file_exists(ini_file):
        print("Usage: -ini <full path to the configuration file.>")
        exit(-1)
    return ini_file
1190747
def _get_config(config_file):
    ''''''
    parser = ConfigParser.SafeConfigParser()
    if os.path.lexists(config_file):
        try:
            log.info('Reading config: %s', config_file)
            inp = open(config_file)
            parser.readfp(inp)
            return parser
        except (IOError, ConfigParser.ParsingError), err:
            raise ConfigError("Failed to read configuration %s\n%s" % (config_file, err))
    return None
94129
def read_config(self):
        
        try:
            with open(self.config_file, 'r') as f:
                self.config = json.loads(f.read())
                f.close()
        except IOError:
            return False
        return True
500805
def read_config_files(files)
      config = clone

      files.each do |file|
        unless File.exist?(file)
          raise ConfigurationFileNotFound, "Unable to load config file: #{file}"
        end

        config = config.deep_merge(read_config_file(file))
      end

      config.replace_values_from_env
    end
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);
            }
        }
    }
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
811306
def read_yaml_configuration(filename):
    '''
    '''
    with open(filename, 'r') as f:
        config = yaml.load(f.read())
    return config
381553
def _read_configuration_file(self, config_filename):
        
        config = configparser.ConfigParser()
        config.read(config_filename)

        self._parent_class_name = config.get('wrapper', 'parent_class')
        self._parent_class_namespace = config.get('wrapper', 'parent_class_namespace')
        self._wrapper_class_name = config.get('wrapper', 'wrapper_class')
        self._wrapper_filename = config.get('wrapper', 'wrapper_file')
        self._metadata_filename = config.get('wrapper', 'metadata')
        self._lob_as_string_flag = config.get('wrapper', 'lob_as_string')
443615
def _read_configfile(self):
        """"""
        rc = self.config_filename
        if not os.path.isabs(rc):
            rc = os.path.join(os.path.expanduser('~'), self.config_filename)
        # If there is a setup.cfg in the package, parse it
        files = [f for f in [rc, 'setup.cfg'] if os.path.exists(f)]
        if not files:
            self.config = None
            return
        self.config = ConfigParser()
        self.config.read(files)
        if (not self.is_old_pypi_config() and
                not self.is_new_pypi_config()):
            # Safety valve
            self.config = None
30038
def read_writer_config(config_files, loader=UnsafeLoader):
    """"""

    conf = {}
    LOG.debug('Reading %s', str(config_files))
    for config_file in config_files:
        with open(config_file) as fd:
            conf.update(yaml.load(fd.read(), Loader=loader))

    try:
        writer_info = conf['writer']
    except KeyError:
        raise KeyError(
            "Malformed config file {}: missing writer 'writer'".format(
                config_files))
    writer_info['config_files'] = config_files
    return writer_info
907441
def read_config(config_path=CONFIG_PATH):
    
    if not os.path.isfile(config_path):
        raise IOError("No config file found at %s" % config_path)
    config_parser = configparser.ConfigParser()
    config_parser.read(config_path)
    config = _config_parser_to_defaultdict(config_parser)
    return config
1253771
def load(self):
        """"""
        try:
            with open(self.config_file) as configfile:
                self.config = yaml.load(configfile)
        except TypeError:
            # no config file (use environment variables)
            pass
        if self.config:
            self.prefix = self.config.get('config_prefix', None)
        if not self.prefix:
            if os.getenv(self.config_prefix):
                self.prefix = os.getenv(self.config_prefix)
            else:
                for path in [
                    os.path.join(self.basepath, self.default_file),
                    os.path.join(self.config_root, self.default_file)
                ]:
                    if os.path.exists(path):
                        with open(path) as conf:
                            config = yaml.load(conf)
                            prefix = config.get(
                                self.config_prefix.lower(), None
                            )
                            if prefix:
                                self.prefix = prefix
                                break
1174839
def read_config_files(files):
    """"""

    config = ConfigObj()

    for _file in files:
        _config = read_config_file(_file)
        if bool(_config) is True:
            config.merge(_config)
            config.filename = _config.filename

    return config
1051763
def parsed_file(config_file):
    """"""
    parser = ConfigParser(allow_no_value=True)
    parser.readfp(config_file)
    return parser
822015
def read_config_file(file)
      next_config = safe_load_file(file)
      check_config_is_hash!(next_config, file)
      Bunto.logger.info "Configuration file:", file
      next_config
    rescue SystemCallError
      if @default_config_file ||= nil
        Bunto.logger.warn "Configuration file:", "none"
        {}
      else
        Bunto.logger.error "Fatal:", "The configuration file '#{file}'
          could not be found."
        raise LoadError, "The Configuration file '#{file}' could not be found."
      end
    end