Documentation Index

Why INI Files

INI Format

THIS uses INI files for many aspects of configuration. Currently, there are least three. All INI files are described in detail within them or within their corresponding module.

This document provides an overview of why we decided to use INI files for configuration.

An INI file is one of the simplest ways to store user configuration data; so common is INI file usage that we need not provide any examples beyond stating that PHP provides a function to convert INI files directly into an array.

While an SQL based database is incredibly useful, it is as ill-suited for handling only a few dozen configuration values, as an INI file is ill-suited for storing large amounts of distributed data.

An INI file can be a good choice for many reasons:

  • Human readable.
  • A universally understood format.
  • Editable by any text editor and/or command line tools.
  • Transferable through any medium.
  • Easily stored within any medium — even a database.

An INI file can be considered a self-creating database. One can use the simplest of text editors to write many lines of data, and with one function call turn that data into an associative array — something that cannot be done with any sort of database. JSON encoding has similar traits. XML does not.

An INI file is also suitable for remote configuration. Storing basic configuration data in a database requires a large "front end" application to support it, whereas with basic configuration in a text file one can use many simple ways to change the data — SSH, FTP, cPanel, etc.

Add in the ability to configure the core (or "start up") code by remote, without having to use the program itself, an INI file for basic configuration is a good choice.

Notes
  1. We do have, somewhere, an XML encode/decode API which converts PHP associative arrays to XML and back.