Zesk Configuration File format

TODO Way out of date

The Zesk configuration file format allows for diverse structures to be embedded in a plain text file and is used primarily for loading application default settings.

Main call

new zesk\Configuration\Parser\CONF(...)

The main workhorse of the configuration file processing is conf::parse which takes a list of file lines and a set of options.

The options affect how the file is loaded, and what features are present in the file. All options are optional, but you should be aware of their defaults The options available are:

Class is zesk\Configuration\Parser\CONF to set default configuration settings.

Built-in features

The Zesk configuration format was designed to work easily with shell programs such as bash or sh to enable sharing settings between PHP and other types of scripts. Zesk configuration files support the following features:

Automatic stripping of the term "export " from variables names.

So:

export LOG_PATH=/var/log

AND

LOG_PATH=/var/log

Are equivalent. The "export " portion of the variable name is removed prior to setting.

Variables substitution

If a variable is already defined, it will be substituted using bash variable syntax:

LOG_PATH=${HOME}/log
READER_LOG_PATH=${LOG_PATH}/reader/
HTTPD_LOG_PATH=${LOG_PATH}/httpd/

If a variable is undefined, then it is replaced with blanks.

Name munging

Configuration file names can use __ (double underscore) and ___ (triple underscore) which are converted to :: and \ respectively making it easier to specify complex class paths in the Shell if needed.

e.g.

zesk___Application__version="5.0.0"
zesk\Appliction::version="5.0.0"

Both are equivalent.

Other features

As with all things Zesk, the default configuration file behavior can be overridden by specific applications. The main configuration file processing logic appears in Zesk_Application::configure and follows this pseudo-code:

TODO