Questions tagged [ini]

The INI file format includes text-based initialization information for programs. Its structure is composed of "sections" and "properties".

INI is a file format for saving configurations. They are basic text files with a specified format. An INI file contains key/value pairs, which are divided into sections. For example, an INI file for a mobile phone OS could look like this.

[graphics]
login_screen=mountains
desktop_back=earth_from_space
look_and_feel=classic_layout

[securite]
enable_password = true
;should a password be required to unlock the phone
password_on_unlock = true 
password = AC4d201cxDAc30F5AC4d201cxDAc30F5

A section name is put between square brackets. Each line after the section title contains a key/value pair, separated by an equals sign (=). Lines starting with a semicolon are comments.

The INI file format is not well defined, many implementations handle INI files differently. Some ignore whitespaces in key or value names, while some don't. Some implementations allow for the number sign (#) for comments, while some others don't.

1656 questions
13
votes
2 answers

php ini creating arrays with parse_ini_file

Is it possible to create an array with a settings file? In the index.php file there it reads .ini file: // Parse config file $settings = parse_ini_file("settings"); E.g. Settings file looks like this: [States] east = "Michigan, New York,…
chrisjlee
  • 21,691
  • 27
  • 82
  • 112
13
votes
1 answer

How to highlight "ini files" in Eclipse

How do I make Eclipse to highlight .ini files? In the menu Window/Preferences, General/Content Types, Test/Configutation files, in the box "File associations:" I can see: *.cfg (locked) *.ini (locked) but I don't know either if this has something to…
Xavi Montero
  • 9,239
  • 7
  • 57
  • 79
12
votes
4 answers

Recommended way to read and write .ini files

Are any methods available in VBA to read and write INI files? I know I could use; Open "C:\test.ini" For Input As #1 ...and parse the data. Instead I am trying to see what tools are already available. I know in C# you can do... using INI; INIFile…
Curtis Inderwiesche
  • 4,940
  • 19
  • 60
  • 82
12
votes
7 answers

PHP Configuration Storage

Ways to store configuration for a Web App written in PHP? I've seen people use .ini, basic .php, etc. Also, define() or simple global variables? Most information as you can find. Also, are databases good methods of storing configuration?
Joshwaa
  • 840
  • 1
  • 11
  • 22
12
votes
3 answers

configuration file editor in Eclipse

Greetings, Anybody uses Eclipse to edit configuration files like httpd.conf and the likes, or even shell scripts? Which editors are there for that? Thanks. Pedro.
12
votes
4 answers

How to set config=value in php.ini with Puppet?

I'm doing my first steps in Puppet and ran into a problem. I've installed PHP on a Linux server and I want to do some slightly changes to php.ini file. I don't want to overwrite the whole ini file with one from repository, just change/create one…
mibutec
  • 2,929
  • 6
  • 27
  • 39
11
votes
5 answers

Convert array to an .ini file

I need to parse an .ini file into an array, and later change the values of the array and export it to the same .ini file. I managed to read the file, but didn’t find any simple way to write it back. Any suggestions? Sample .ini file: 1 = 0; 2 =…
user2216190
  • 784
  • 5
  • 10
  • 25
10
votes
4 answers

How can I separate the sections in an INI file?

When saving to an INI file, especially when more than one section is defined, the data is saved all together with no lines between the sections. For external editing purposes it would be handy to separate each section with a line break, to make it…
user741875
10
votes
7 answers

eclipse ini configuration

actually i and my friend are trying to learn and use eclipse 3.4 and we are having some heap memory issue while working, and my friend suggested to increase the memory allocation to eclipse ide as he has 4GB RAM and he wants to allocate enough heap,…
Gunwant Saini
  • 317
  • 3
  • 10
  • 17
10
votes
2 answers

boost::program_options - how to handle multiple sections with the same name in INI file

In a config like below; is there a way to handle individual sections. I am looking for a way to validate individual "server" sections below, in a reliable manner. [basic] number_of_servers=3 [server] ip=10.20.30.40 password=sdfslkhf …
ϹοδεMεδιϲ
  • 2,790
  • 3
  • 33
  • 54
10
votes
3 answers

Why use dotenv library instead of parsing ini file?

Within PHP, *.ini files can be read by using parse_ini_file(). However, various frameworks (Laravel included) opt to, instead, bring in a separate library to parse an environment file. What is the reasoning behind using this "dotenv" solution…
Lijiebin
  • 113
  • 7
10
votes
1 answer

Parsing INI file with PHP when semi-colon (;) is included in the value

I am storing translations in my INI file in my system and they are stored in this manner: $ini=parse_ini_file('translations.ini',false,INI_SCANNER_RAW); This INI_SCANNER_RAW setting tells PHP, according to documentation, that: If INI_SCANNER_RAW…
kingmaple
  • 4,200
  • 5
  • 32
  • 44
9
votes
1 answer

How to document options in an INI file with Sphinx

I'd like to document an INI file in my Sphinx documentation. What markup should I use? Whenever I search the Web I get description of Sphinx configuration file—conf.py. The standard domain has some tools to document command-line programs and one…
9
votes
3 answers

PHP - Parse ini file and access single values

In Python you can parse an .ini file and access the single values like this: myini.ini [STRINGS] mystring = fooooo value = foo_bar script.py import configparser config = configparser.ConfigParser() #…
Black
  • 18,150
  • 39
  • 158
  • 271
9
votes
2 answers

Can I have logging.ini file without root logger?

Here is how my logging.ini file looks like:…
Tejas
  • 189
  • 2
  • 9