Read this component's configuration from the database
493104
def _read_config(self):
        """"""

        try:
            self.config = self.componentmodel.find_one(
                {'name': self.uniquename})
        except ServerSelectionTimeoutError:  # pragma: no cover
            self.log("No database access! Check if mongodb is running "
                     "correctly.", lvl=critical)
        if self.config:
            self.log("Configuration read.", lvl=verbose)
        else:
            self.log("No configuration found.", lvl=warn)
1130534
private function loadConfigData()
    {
        //Load config data
        $config = laradooConfig();


        $this->suffix = array_key_exists('api-suffix', $config) ? $config['api-suffix'] : $this->suffix;
        $this->suffix = laradooAddCharacter($this->suffix, '/');

        $this->host = array_key_exists('host', $config) ? $config['host'] : $this->host;
        $this->host = laradooRemoveCharacter($this->host, '/');

        $this->db = array_key_exists('db', $config) ? $config['db'] : $this->db;
        $this->username = array_key_exists('username', $config) ? $config['username'] : $this->username;
        $this->password = array_key_exists('password', $config) ? $config['password'] : $this->password;
    }
516039
public function loadDoctrineConfiguration(): void
	{
		$builder = $this->getContainerBuilder();
		$config = $this->validateConfig($this->defaults['configuration'], $this->config['configuration']);

		$logger = $builder->addDefinition($this->prefix('logger'))
			->setType(LoggerChain::class)
			->setAutowired('self');

		$configuration = $builder->addDefinition($this->prefix('configuration'));
		$configuration->setFactory(Configuration::class)
			->setAutowired(false)
			->addSetup('setSQLLogger', [$this->prefix('@logger')]);

		// SqlLogger (append to chain)
		if ($config['sqlLogger'] !== null) {
			$logger->addSetup('addLogger', [$config['sqlLogger']]);
		}

		// ResultCacheImpl
		if ($config['resultCacheImpl'] !== null) {
			$configuration->addSetup('setResultCacheImpl', [$config['resultCacheImpl']]);
		}

		// FilterSchemaAssetsExpression
		if ($config['filterSchemaAssetsExpression'] !== null) {
			$configuration->addSetup('setFilterSchemaAssetsExpression', [$config['filterSchemaAssetsExpression']]);
		}

		// AutoCommit
		Validators::assert($config['autoCommit'], 'bool', 'configuration.autoCommit');
		$configuration->addSetup('setAutoCommit', [$config['autoCommit']]);
	}
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();
                }
            }
        }
    }
146803
private Multimap<String, Setting> loadComponentSettings(DbSession dbSession, Set<String> keys, ComponentDto component) {
    List<String> componentUuids = DOT_SPLITTER.splitToList(component.moduleUuidPath());
    List<ComponentDto> componentDtos = dbClient.componentDao().selectByUuids(dbSession, componentUuids);
    Set<Long> componentIds = componentDtos.stream().map(ComponentDto::getId).collect(Collectors.toSet());
    Map<Long, String> uuidsById = componentDtos.stream().collect(Collectors.toMap(ComponentDto::getId, ComponentDto::uuid));
    List<PropertyDto> properties = dbClient.propertiesDao().selectPropertiesByKeysAndComponentIds(dbSession, keys, componentIds);
    List<PropertyDto> propertySets = dbClient.propertiesDao().selectPropertiesByKeysAndComponentIds(dbSession, getPropertySetKeys(properties), componentIds);

    Multimap<String, Setting> settingsByUuid = TreeMultimap.create(Ordering.explicit(componentUuids), Ordering.arbitrary());
    for (PropertyDto propertyDto : properties) {
      Long componentId = propertyDto.getResourceId();
      String componentUuid = uuidsById.get(componentId);
      String propertyKey = propertyDto.getKey();
      settingsByUuid.put(componentUuid,
        Setting.createFromDto(propertyDto, getPropertySets(propertyKey, propertySets, componentId), propertyDefinitions.get(propertyKey)));
    }
    return settingsByUuid;
  }
688884
private void getConfigurationObject()
    {
        RDBMSPropertyReader reader = new RDBMSPropertyReader(externalProperties, kunderaMetadata
                .getApplicationMetadata().getPersistenceUnitMetadata(getPersistenceUnit()));
        this.conf = reader.load(getPersistenceUnit());
    }
861362
def read_configuration(self):
        
        # get distutils to do the work
        c = self._get_pypirc_command()
        c.repository = self.url
        cfg = c._read_pypirc()
        self.username = cfg.get('username')
        self.password = cfg.get('password')
        self.realm = cfg.get('realm', 'pypi')
        self.url = cfg.get('repository', self.url)
890864
def _read_configuration(config_filename):
        
        config = ConfigParser()
        config.read(config_filename)

        if 'supplement' in config['database']:
            path = os.path.dirname(config_filename) + '/' + config.get('database', 'supplement')
            config_supplement = ConfigParser()
            config_supplement.read(path)
        else:
            config_supplement = None

        return config, config_supplement
1262568
private ModelNode readProviderConfiguration() {
        ModelNode op = new ModelNode();
        op.get(ADDRESS).set(WS_SUBSYSTEM.resolve(statementContext));
        op.get(OP).set(READ_RESOURCE_OPERATION);
        op.get(INCLUDE_RUNTIME).set(true);
        return op;
    }
1361207
public function getComponentConfig($componentName)
    {
        $result = null;
        $config = $this->getConfiguration();
        if (isset($config[self::COMPONENT_CONFIG_BLOCK][$componentName])) {
            $result = $config[self::COMPONENT_CONFIG_BLOCK][$componentName];
        }
        return $result;
    }
685264
private void parseSQLConfig(final Node node, final ConfigSettings config)
	{

		String name, value;
		Node nnode;
		NodeList list = node.getChildNodes();

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

			name = nnode.getNodeName().toUpperCase();
			if (name.equals(KEY_HOST)) {

				value = nnode.getChildNodes().item(0).getNodeValue();
				config.setConfigParameter(ConfigurationKeys.SQL_HOST, value);

			}
			else if (name.equals(KEY_DATABASE)) {

				value = nnode.getChildNodes().item(0).getNodeValue();
				config.setConfigParameter(ConfigurationKeys.SQL_DATABASE, value);

			}
			else if (name.equals(KEY_USER)) {

				value = nnode.getChildNodes().item(0).getNodeValue();
				config.setConfigParameter(ConfigurationKeys.SQL_USERNAME, value);

			}
			else if (name.equals(KEY_PASSWORD)) {

				value = nnode.getChildNodes().item(0).getNodeValue();
				config.setConfigParameter(ConfigurationKeys.SQL_PASSWORD, value);
			}
		}
	}
1042030
private static void readField(DatabaseFieldConfig config, String field, String value) {
		if (field.equals(FIELD_NAME_FIELD_NAME)) {
			config.setFieldName(value);
		} else if (field.equals(FIELD_NAME_COLUMN_NAME)) {
			config.setColumnName(value);
		} else if (field.equals(FIELD_NAME_DATA_PERSISTER)) {
			config.setDataPersister(DataType.valueOf(value).getDataPersister());
		} else if (field.equals(FIELD_NAME_DEFAULT_VALUE)) {
			config.setDefaultValue(value);
		} else if (field.equals(FIELD_NAME_WIDTH)) {
			config.setWidth(Integer.parseInt(value));
		} else if (field.equals(FIELD_NAME_CAN_BE_NULL)) {
			config.setCanBeNull(Boolean.parseBoolean(value));
		} else if (field.equals(FIELD_NAME_ID)) {
			config.setId(Boolean.parseBoolean(value));
		} else if (field.equals(FIELD_NAME_GENERATED_ID)) {
			config.setGeneratedId(Boolean.parseBoolean(value));
		} else if (field.equals(FIELD_NAME_GENERATED_ID_SEQUENCE)) {
			config.setGeneratedIdSequence(value);
		} else if (field.equals(FIELD_NAME_FOREIGN)) {
			config.setForeign(Boolean.parseBoolean(value));
		} else if (field.equals(FIELD_NAME_USE_GET_SET)) {
			config.setUseGetSet(Boolean.parseBoolean(value));
		} else if (field.equals(FIELD_NAME_UNKNOWN_ENUM_VALUE)) {
			String[] parts = value.split("#", -2);
			if (parts.length != 2) {
				throw new IllegalArgumentException(
						"Invalid value for unknownEnumValue which should be in class#name format: " + value);
			}
			Class<?> enumClass;
			try {
				enumClass = Class.forName(parts[0]);
			} catch (ClassNotFoundException e) {
				throw new IllegalArgumentException("Unknown class specified for unknownEnumValue: " + value);
			}
			Object[] consts = enumClass.getEnumConstants();
			if (consts == null) {
				throw new IllegalArgumentException("Invalid class is not an Enum for unknownEnumValue: " + value);
			}
			@SuppressWarnings("rawtypes")
			Enum[] enumConstants = (Enum[]) consts;
			boolean found = false;
			for (Enum<?> enumInstance : enumConstants) {
				if (enumInstance.name().equals(parts[1])) {
					config.setUnknownEnumValue(enumInstance);
					found = true;
				}
			}
			if (!found) {
				throw new IllegalArgumentException("Invalid enum value name for unknownEnumvalue: " + value);
			}
		} else if (field.equals(FIELD_NAME_THROW_IF_NULL)) {
			config.setThrowIfNull(Boolean.parseBoolean(value));
		} else if (field.equals(FIELD_NAME_FORMAT)) {
			config.setFormat(value);
		} else if (field.equals(FIELD_NAME_UNIQUE)) {
			config.setUnique(Boolean.parseBoolean(value));
		} else if (field.equals(FIELD_NAME_UNIQUE_COMBO)) {
			config.setUniqueCombo(Boolean.parseBoolean(value));
		} else if (field.equals(FIELD_NAME_INDEX)) {
			config.setIndex(Boolean.parseBoolean(value));
		} else if (field.equals(FIELD_NAME_INDEX_NAME)) {
			config.setIndex(true);
			config.setIndexName(value);
		} else if (field.equals(FIELD_NAME_UNIQUE_INDEX)) {
			config.setUniqueIndex(Boolean.parseBoolean(value));
		} else if (field.equals(FIELD_NAME_UNIQUE_INDEX_NAME)) {
			config.setUniqueIndex(true);
			config.setUniqueIndexName(value);
		} else if (field.equals(FIELD_NAME_FOREIGN_AUTO_REFRESH)) {
			config.setForeignAutoRefresh(Boolean.parseBoolean(value));
		} else if (field.equals(FIELD_NAME_MAX_FOREIGN_AUTO_REFRESH_LEVEL)) {
			config.setMaxForeignAutoRefreshLevel(Integer.parseInt(value));
		} else if (field.equals(FIELD_NAME_PERSISTER_CLASS)) {
			try {
				@SuppressWarnings("unchecked")
				Class<? extends DataPersister> clazz = (Class<? extends DataPersister>) Class.forName(value);
				config.setPersisterClass(clazz);
			} catch (ClassNotFoundException e) {
				throw new IllegalArgumentException("Could not find persisterClass: " + value);
			}
		} else if (field.equals(FIELD_NAME_ALLOW_GENERATED_ID_INSERT)) {
			config.setAllowGeneratedIdInsert(Boolean.parseBoolean(value));
		} else if (field.equals(FIELD_NAME_COLUMN_DEFINITION)) {
			config.setColumnDefinition(value);
		} else if (field.equals(FIELD_NAME_FULL_COLUMN_DEFINITION)) {
			config.setFullColumnDefinition(value);
		} else if (field.equals(FIELD_NAME_FOREIGN_AUTO_CREATE)) {
			config.setForeignAutoCreate(Boolean.parseBoolean(value));
		} else if (field.equals(FIELD_NAME_VERSION)) {
			config.setVersion(Boolean.parseBoolean(value));
		} else if (field.equals(FIELD_NAME_FOREIGN_COLUMN_NAME)) {
			config.setForeignColumnName(value);
		} else if (field.equals(FIELD_NAME_READ_ONLY)) {
			config.setReadOnly(Boolean.parseBoolean(value));
		}
		/**
		 * foreign collection field information
		 */
		else if (field.equals(FIELD_NAME_FOREIGN_COLLECTION)) {
			config.setForeignCollection(Boolean.parseBoolean(value));
		} else if (field.equals(FIELD_NAME_FOREIGN_COLLECTION_EAGER)) {
			config.setForeignCollectionEager(Boolean.parseBoolean(value));
		} else if (field.equals(FIELD_NAME_MAX_EAGER_FOREIGN_COLLECTION_LEVEL_OLD)) {
			config.setForeignCollectionMaxEagerLevel(Integer.parseInt(value));
		} else if (field.equals(FIELD_NAME_MAX_EAGER_FOREIGN_COLLECTION_LEVEL)) {
			config.setForeignCollectionMaxEagerLevel(Integer.parseInt(value));
		} else if (field.equals(FIELD_NAME_FOREIGN_COLLECTION_COLUMN_NAME)) {
			config.setForeignCollectionColumnName(value);
		} else if (field.equals(FIELD_NAME_FOREIGN_COLLECTION_ORDER_COLUMN_NAME_OLD)) {
			config.setForeignCollectionOrderColumnName(value);
		} else if (field.equals(FIELD_NAME_FOREIGN_COLLECTION_ORDER_COLUMN_NAME)) {
			config.setForeignCollectionOrderColumnName(value);
		} else if (field.equals(FIELD_NAME_FOREIGN_COLLECTION_ORDER_ASCENDING)) {
			config.setForeignCollectionOrderAscending(Boolean.parseBoolean(value));
		} else if (field.equals(FIELD_NAME_FOREIGN_COLLECTION_FOREIGN_FIELD_NAME_OLD)) {
			config.setForeignCollectionForeignFieldName(value);
		} else if (field.equals(FIELD_NAME_FOREIGN_COLLECTION_FOREIGN_FIELD_NAME)) {
			config.setForeignCollectionForeignFieldName(value);
		}
	}
449429
def _read_config(cls):
        

        cls._config_parser = configparser.ConfigParser()
        cls._config_parser.read(cls._default_attribute_values_configuration_file_path)
449251
def external_data_configuration(self):
        
        prop = self._properties.get("externalDataConfiguration")
        if prop is not None:
            prop = ExternalConfig.from_api_repr(prop)
        return prop
1083251
private Configuration getConfigByName(String name) {
    if (config != null) {
      for (Configuration c : config) {
        if (c != null && c.getStringValue(Parameters.ConcurrentEntityName.ordinal(), "").equals(name)) {
          return c;
        }
      }
    }
    return null;
  }
1172032
def database_configuration
       require 'erb'
       YAML::load(ERB.new(IO.read(database_configuration_file)).result) if File.exists?(database_configuration_file)
     end
1237662
function readConfig() {
  let options = {}
  let cFile = ''

  if (program.config) {
    cFile = path.resolve(cwd, program.config)
    if (fs.existsSync(cFile)) {
      Object.assign(config, require(cFile))
    } else {
      console.warn(`Cannot find configuration file ${program.config}`)
      process.exit()
    }
  } else {
    cFile = path.resolve(cwd, 'deploy.js')
  }

  if (fs.existsSync(cFile)) {
    options = require(cFile)
  }

  ;['server', 'ignore'].forEach(function(name) {
    if (typeof program[name] !== 'undefined') {
      options[name] = program[name]
    }
  })

  if (program.args[0]) {
    options.workspace = path.resolve(cwd, program.args[0])
  }

  if (program.args[1]) {
    options.deployTo = program.args[1]
  }

  return options
}