configuration-files

Pros and cons for different configuration formats?

一个人想着一个人 提交于 2019-12-03 11:33:22
问题 I've seen people using *.cfg (Python Buildout), *.xml (Gnome), *.json (Chrome extension), *.yaml (Google App Engine), *.ini and even *.py for app configuration files (like Django). My question is: why there are so many different configuration file formats? I can see an advantage from a xml vs json approach (much less verbose) or a Python one (sometimes you have a Python app and don't want to use a specific module just to parse a config file), but what about the other approaches? I know there

ConfigObj/ConfigParser vs. using YAML for Python settings file

ⅰ亾dé卋堺 提交于 2019-12-03 09:45:40
Which is better for creating a settings file for Python programs, the built-in module (ConfigParser) or the independent project (ConfigObj), or using the YAML data serialization format? I have heard that ConfigObj is easier to use than ConfigParser, even though it is not a built-in library. I have also read that PyYAML is easy to use, though YAML takes a bit of time to use. Ease of implementation aside, which is the best option for creating a settings/configuration file? Using ConfigObj is at least very straightforward and ini files in general are much simpler (and more widely used) than YAML.

Java equivalent to app.config?

血红的双手。 提交于 2019-12-03 09:19:07
问题 Is there a Java equivalent to .NET's App.Config? If not is there a standard way to keep you application settings, so that they can be changed after an app has been distributed? 回答1: For WebApps, web.xml can be used to store application settings. Other than that, you can use the Properties class to read and write properties files. You may also want to look at the Preferences class, which is used to read and write system and user preferences. It's an abstract class, but you can get appropriate

Tools for previewing configuration file transformations

蹲街弑〆低调 提交于 2019-12-03 09:02:45
问题 Are there any tools or Visual Studio 2010 extensions which allow me to view the output of a configuration file transformation short of having to publish the entire project? Is the process which performs the transformation directly invokable? Edit After a little more Googling I came across this: Step 4: Generating a new transformed web.config file for “Staging” environment from command line Open Visual Studio Command prompt by going to Start --> Program Files –> Visual Studio v10.0 –> Visual

Two different providers on the same config file

不羁岁月 提交于 2019-12-03 08:24:15
Im using EntityFramework 6.1.0 I have 2 providers . MysqlClient and SQLServerCE, and i need to create 2 different DBContext. That forced me to create 2 configuration classes because mysql have some different things. But when i initialize the application, the Database.DefaultConnectionFactory is from the defaultConnectionFactory(config file) , and i cant specify what provider to take on the daterminated Context. How to do it? My config file: <entityFramework> <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlCeConnectionFactory, EntityFramework"> <parameters> <parameter value

Where do you put your app-config-files when deploying rails with capistrano and svn

蓝咒 提交于 2019-12-03 08:21:57
I have two config-files /app/config/database.yml and /app/config/userconfig.yml i don't want to put the database credentials and userconfig in the svn-repository, so i have database.yml.dist and userconfig.yml.dist checked in. What is the best way to get copys of the dist-files in the shared-directory when deploying the app for the first time? For later deploys i'll link to them from /app/current/config You should place your config files in /path/to/deployed_app/shared Then in a capistrano task, sym link to those files: namespace :deploy do task :symlink_shared do run "ln -s #{shared_path}

What is the best way to serialize Delphi application configuration?

狂风中的少年 提交于 2019-12-03 07:04:26
问题 I will answer this question myself, but feel free to provide your answers if you are faster than me or if you don't like my solution. I just came up with this idea and would like to have some opinions on that. Goal: a configuration class that is readable (like an INI-file) but without having to write (and adapt after a new configuration item has been added) the load and save methods. I want to create a class like TMyConfiguration = class (TConfiguration) ... property ShowFlags : Boolean read

How to create a custom yaml config file in Symfony

99封情书 提交于 2019-12-03 06:59:50
问题 What I want to do is quite simple: store data in a custom config file that I want to read later on. I created my file something.yml that I put in the global config directory. It looks like that: prod: test: ok dev: test: ko all: foo: bar john: doe Then I copied the config_handlers.yml and also put it in the config directory and added the following at the top of the file: config/something.yml: class: sfDefineEnvironmentConfigHandler param: prefix: something_ But if I'm calling sfConfig::get(

Where is the varnish configuration file?

时光毁灭记忆、已成空白 提交于 2019-12-03 06:42:45
I have just installed varnish and its ready to serve web pages. Problem is that we are hitting open files limit. We have already set ulimit to varnish user. We want to find a file where we can write this configuration: # Maximum number of open files NFILES=131072 # Locked shared memory, default log size is 82MB + header MEMLOCK=82000 ## Configuration with VCL # # Listen on port 80, administration on localhost:6082, and forward to # one content server selected by the vcl file, based on the request. Use a # fixed-size cache file. # # Note: you must replace "example.org" with the outside IP

Separating configuration data and script logic in Perl scripts

风流意气都作罢 提交于 2019-12-03 06:31:58
I find the following anti-pattern repeated in my Perl scripts: the script contains some machine/setup specific settings which I store in-line as constants in the script whereas the rest of the script is general in nature: #!/usr/bin/perl use strict; use warnings; # machine specific settings at the start of the script. my $SETTING_1 = "foo"; my @SETTING_2 = ("123", "456"); my $SETTING_3 = "something"; # general part of script follows. ... This pattern is somewhat okay when running on one machine, but as soon as I want to distribute the script to multiple machines the trouble starts since I must