Creates the main config file. IF <code>tebase</code> is not found it will
throw a <code>TEBaseNotFoundException</code>.

@param tebase
177585
public void create(String tebase) throws TEException {
		File f = new File(tebase);
		if (f.exists()) {
			try {
				process(tebase);
			} catch (Exception e) {
				e.printStackTrace();
			}
		} else {
			throw new TEBaseNotFoundException(tebase);
		}
	}
1023673
protected static function createDatabaseConfiguration()
    {
        $config          = new JConfig();
        $dsn             = $config->dbtype . '://' . $config->user . ':' . $config->password . '@' . $config->host . '/' . $config->db;
        $dataMapperClass = PrefixedDoctrineDataMapper::class;

        $ini = <<<INI
databaseUrl="$dsn"
definitionPath="entities"
dataMapper="$dataMapperClass"
INI;
        file_put_contents(JPATH_ROOT . '/config/database.ini', $ini);
    }
454788
protected function createConfig()
    {
        $this->setCliMessage('Creating configuration file...');

        $config = file_get_contents(GC_FILE_CONFIG);

        if (empty($config)) {
            $error = $this->translation->text('Failed to read file @path', array('@path' => GC_FILE_CONFIG));
            throw new UnexpectedValueException($error);
        }

        $config .= '$config[\'database\'] = ' . var_export($this->data['database'], true) . ';';
        $config .= PHP_EOL . PHP_EOL;
        $config .= 'return $config;';
        $config .= PHP_EOL;

        if (file_put_contents(GC_FILE_CONFIG_COMPILED, $config) === false) {
            throw new UnexpectedValueException($this->translation->text('Failed to create config.php'));
        }

        chmod(GC_FILE_CONFIG_COMPILED, 0444);
    }
46995
public void init(Configuration configuration)
			throws Exception
	{
		String baseName = configuration.getBootstrapPropertyResolver().getProperty("ResourceBundleFactory.Bundle");
		if (baseName != null)
		{
			this.baseName = baseName;
		}
	}
517679
public void setCrunchbase(String crunchbase) {
    if(crunchbase != null) {
      crunchbase = crunchbase.trim();
    }
    this.crunchbase = crunchbase;
  }
683980
public void generateConfig(File configFile, ContainerRoot model) throws IOException {
        StringBuilder buffer = new StringBuilder();
        buffer.append(OSHelper.read(this.getClass().getClassLoader().getResourceAsStream("base.cfg")));
        buffer.append("\n");
        HashMap<String, Backend> backends = new HashMap<String, Backend>();
        for (ContainerNode node : model.getNodes()) {
            for (ComponentInstance instance : node.getComponents()) {
                if (instance.getTypeDefinition().getDictionaryType() != null
                        && instance.getTypeDefinition().getDictionaryType().findAttributesByID("http_port") != null
                        && instance.getStarted()
                        && !instance.getName().equals(context.getInstanceName())) {

                    if (!backends.containsKey(instance.getTypeDefinition().getName())) {
                        Backend backend = new Backend();
                        backends.put(instance.getTypeDefinition().getName(), backend);
                    }
                    Backend backend = backends.get(instance.getTypeDefinition().getName());
                    backend.setName(instance.getTypeDefinition().getName());
                    Server s = new Server();
                    s.setIp("127.0.0.1");
                    s.setName(instance.getName());
                    s.setPort(instance.getDictionary().findValuesByID("http_port").getValue());
                    backend.getServers().add(s);
                }
            }
        }

        if (backends.size() > 0) {
            buffer.append("default_backend ");
            String firstKey = backends.keySet().iterator().next();
            buffer.append(backends.get(firstKey).getName());
            buffer.append("\n");
        }
        for (String key : backends.keySet()) {
            buffer.append("\n");
            buffer.append(backends.get(key));
            buffer.append("\n");
        }
        FileWriter writer = new FileWriter(configFile);
        writer.write(buffer.toString());
        writer.close();
    }
451797
public Configuration build() {
    Validate.notNull(this.submissionRuntime, "Default Runtime was not defined");

    if(!this.defaultRuntime.isPresent() || this.runtimeNames.size() == 1){
      this.defaultRuntime = Optional.of(this.runtimeNames.toArray(new String[0])[0]);
    }

    Validate.isTrue(this.defaultRuntime.isPresent(),
            "Default runtime was not defined, and multiple runtimes were specified");

    if(!this.runtimeNames.contains(this.defaultRuntime.get())){
      this.runtimeNames.add(this.defaultRuntime.get());
    }

    JavaConfigurationBuilder conf = Tang.Factory.getTang().newConfigurationBuilder();

    for(Map.Entry<Class, Object> entry: this.namedParameters.entrySet()){
      conf = conf.bindNamedParameter(entry.getKey(), entry.getValue().toString());
    }

    conf = conf.bindNamedParameter(DefaultRuntimeName.class, this.defaultRuntime.get());

    for(final String runtimeName : this.runtimeNames){
      conf = conf.bindSetEntry(RuntimeNames.class, runtimeName);
    }

    if(!this.submissionRuntime.equalsIgnoreCase(RuntimeIdentifier.RUNTIME_NAME)){
      throw new RuntimeException("Unsupported submission runtime " + this.submissionRuntime);
    }

    conf = conf.bindImplementation(MultiRuntimeMainConfigurationGenerator.class,
            YarnMultiRuntimeMainConfigurationGeneratorImpl.class);

    // Currently only local runtime is supported as a secondary runtime
    return Configurations.merge(conf.build(),
            ExtensibleYarnClientConfiguration.CONF
                    .set(ExtensibleYarnClientConfiguration.DRIVER_CONFIGURATION_PROVIDER,
                            MultiRuntimeDriverConfigurationProvider.class).build());
  }
373313
public static void main(String... args) {
        final String cfgpath = "../docs/configuration/belframework.cfg";
        final File cfgfile = new File(cfgpath);
        try {
            SystemConfiguration syscfg = createSystemConfiguration(cfgfile);
            out.println(syscfg.defaultConfiguration());
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
745662
@SuppressWarnings("ProhibitedExceptionDeclared")
    @PostConstruct
    public void init() throws Exception {
        final String configFileLocation = getConfigFileLocation();
        T fileConfig = getEmptyConfig();

        boolean fileExists = false;

        log.info("Using {} as config file location", configFileLocation);

        try (Reader reader = new BufferedReader(new InputStreamReader(new FileInputStream(configFileLocation), "UTF-8"))) {
            fileConfig = mapper.readValue(reader, getConfigClass());

            if (fileConfig instanceof PasswordsConfig<?>) {
                fileConfig = ((PasswordsConfig<T>) fileConfig).withDecryptedPasswords(textEncryptor);
            }

            fileExists = true;
        } catch (final FileNotFoundException e) {
            log.warn("Config file not found, using empty configuration object");
        } catch (final IOException e) {
            log.error("Error reading config file at {}", configFileLocation);
            log.error("Recording stack trace", e);
            // throw this so we don't continue to start the webapp
            throw new IllegalStateException("Could not initialize configuration", e);
        }

        if (StringUtils.isNotBlank(defaultConfigFile)) {
            try (InputStream defaultConfigInputStream = getClass().getResourceAsStream(defaultConfigFile)) {
                if (defaultConfigInputStream != null) {
                    final T defaultConfig = mapper.readValue(defaultConfigInputStream, getConfigClass());

                    fileConfig = fileConfig.merge(defaultConfig);

                    if (!fileExists) {
                        fileConfig = generateDefaultLogin(fileConfig);

                        try {
                            writeOutConfigFile(fileConfig, configFileLocation);
                        } catch (final IOException e) {
                            throw new IllegalStateException("Could not initialize configuration", e);
                        }
                    }
                }
            } catch (final IOException e) {
                log.error("Error reading default config file", e);
                // throw this so we don't continue to start the webapp
                throw new IllegalStateException("Could not initialize configuration", e);
            }
        }

        try {
            fileConfig.basicValidate("Root");
        } catch (final ConfigException e) {
            log.error("Config validation failed in " + e);
            throw new IllegalStateException("Could not initialize configuration", e);
        }

        config.set(fileConfig);
        postInitialise(getConfig());
    }
969615
protected function createDbConfig()
    {
        $this->setCliMessage('Configuring database...');

        $this->config->set('intro', 1);
        $this->config->set('installed', GC_TIME);
        $this->config->set('cron_key', gplcart_string_random());
        $this->config->set('installer', $this->data['installer']);
        $this->config->set('timezone', $this->data['store']['timezone']);
    }
897902
function writeBaseConfiguration()
    {
        if (! $this->files->exists($this->path())) {
            $this->write(['tld' => 'test', 'paths' => []]);
        }

        /**
         * Migrate old configurations from 'domain' to 'tld'
         */
        $config = $this->read();

        if (isset($config['tld'])) {
            return;
        }

        $this->updateKey('tld', !empty($config['domain']) ? $config['domain'] : 'test');
    }
1333814
public static void main(final String[] args) throws Exception {
        if (args.length != 2) {
            throw new RuntimeException("Invalid build configuration. No command-line arguments specified");
        }
        final var buildDir = args[0];
        final var projectDir = args[1];
        new ConfigurationMetadataGenerator(buildDir, projectDir).execute();
    }
177877
public static Configuration createBasicConfiguration()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "createBasicConfiguration()");

        Configuration config = new Configuration();

        try
        {
            config.loadFromPropertyFile();
        }
        catch (IOException ioe)
        {
            //No FFDC Code Needed.
            config.datasourceClassname = "org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource";
            config.datasourceProperties.setProperty("databaseName",System.getProperty("js.test.dbname","msdb"));
            config.datasourceProperties.setProperty("createDatabase","create");
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "createBasicConfiguration()", config);

        return(config);
    }
1051095
@PostConstruct
	protected void init() throws IOException {
		// base configuration from XML file
		if (null != configurationFile) {
			log.debug("Get base configuration from {}", configurationFile);
			manager = new DefaultCacheManager(configurationFile);
		} else {
			GlobalConfigurationBuilder builder = new GlobalConfigurationBuilder();
			builder.globalJmxStatistics().allowDuplicateDomains(true);
			manager = new DefaultCacheManager(builder.build());
		}

		if (listener == null) {
			listener = new InfinispanCacheListener();
		}
		manager.addListener(listener);

		// cache for caching the cache configurations (hmmm, sounds a bit strange)
		Map<String, Map<CacheCategory, CacheService>> cacheCache = 
				new HashMap<String, Map<CacheCategory, CacheService>>();

		// build default configuration
		if (null != defaultConfiguration) {
			setCaches(cacheCache, null, defaultConfiguration);
		}

		// build layer specific configurations
		for (Layer layer : layerMap.values()) {
			CacheInfo ci = configurationService.getLayerExtraInfo(layer.getLayerInfo(), CacheInfo.class);
			if (null != ci) {
				setCaches(cacheCache, layer, ci);
			}
		}
	}
108888
public Configuration createConfiguration() throws IOException, TemplateException {
        Configuration config = newConfiguration();
        Properties props = new Properties();

        // Merge local properties if specified.
        if (this.freemarkerSettings != null) {
            props.putAll(this.freemarkerSettings);
        }

        // FreeMarker will only accept known keys in its setSettings and
        // setAllSharedVariables methods.
        if (!props.isEmpty()) {
            config.setSettings(props);
        }

        if (this.freemarkerVariables != null && freemarkerVariables.size() > 0) {
            config.setAllSharedVariables(new SimpleHash(this.freemarkerVariables, config.getObjectWrapper()));
        }

        if (this.defaultEncoding != null) {
            config.setDefaultEncoding(this.defaultEncoding);
        }

        // determine FreeMarker TemplateLoader
        if (templateLoaders == null) {
            if (templateLoaderPaths != null && templateLoaderPaths.length > 0) {
                List<TemplateLoader> templateLoaderList = new ArrayList<>();
                for (String path : templateLoaderPaths) {
                    templateLoaderList.add(getTemplateLoaderForPath(path));
                }
                setTemplateLoader(templateLoaderList);
            }
        }

        TemplateLoader templateLoader = getAggregateTemplateLoader(templateLoaders);
        if (templateLoader != null) {
            config.setTemplateLoader(templateLoader);
        }

        // determine CustomTrimDirectives
        if (trimDirectives != null && trimDirectives.length > 0) {
            TrimDirectiveGroup group = new TrimDirectiveGroup(trimDirectives);
            for (Map.Entry<String, Map<String, TrimDirective>> directives : group.entrySet()) {
                config.setSharedVariable(directives.getKey(), directives.getValue());
            }
        }

        return config;
    }
345307
public void configure(String filename, boolean isExternalFile) {
        try {
            Properties properties;
            InputStream inputStream;

            if (!isExternalFile) {
                Resources resources = context.getResources();
                AssetManager assetManager = resources.getAssets();

                inputStream = assetManager.open(filename);
            } else {
                inputStream = new FileInputStream(filename);
            }

            properties = loadProperties(inputStream);
            inputStream.close();

            startConfiguration(properties);
        } catch (IOException e) {
            Log.e(TAG, "Failed to open file. " + filename + " " + e);
        }
    }
610668
def create_config(self, env, conf):
        

        if not isinstance(conf, collections.Mapping):
            raise ValueError("conf must be a collections.Mapping")

        self.zk.ensure_path(self.view_path)

        self._create(
            self._get_env_path(env),
            conf
        )

        self._update_view(env)