A class for accessing application-level configuration information.
This class is a wrapper around an array of configuration information. It obtains the array by calling Support_Resources::config_data(). The default implementation simply uses a global array named APP_CONFIG which it obtains by including the file config.php (which can be located anywhere in the include path). In addition to providing some basic conveniences over direct array access, part of this class's purpose is to provide a simple layer of abstraction around the storage of the configuration values. More advanced applications could replace the provider in Resources with one that retrieves configuration information from an XML file (or other formatted text file) or a database (or even some combination of the two.
This class allows configuration properties to be divided into sections. Sections are separated from the property name using a forward slash character (/). Sections may be nested up to arbitrary depths, but an enclosing section is not required. The forward slash character can therefore not be used in any property name. Sections are implemented in the global array as a nested array.
An example config file (using the default provider):
Of course, the config file is just a PHP file, so any valid PHP code can be used to build the structure.
Examples, of accessing the configuration information:
Located in /support/lib/Cfg.php (line 85)
Test for the existence of a key in the configuration.
Locate the named key in the configuration.
Returns the value of the given key in the configuration. If they key does not exist, any default value provided is returned instead (or NULL if none is provided).
Returns the value of the given key in the configuration. If they key does not exist, MissingRequiredConfigurationError is thrown instead.
Documentation generated on Wed, 25 Apr 2012 09:46:41 -0700 by phpDocumentor 1.4.3