Class Nexista_Config

Description

The configuration system of Nexista is XML based and is designed to allow for multiple modes (i.e live, development, etc...).

Located in /kernel/config.php (line 22)


	
			
Variable Summary
 static string $mode
 static object $xml
Method Summary
 static mixed get (string $name)
 static void getMode (string 0)
 static array getSection (string $name, [string $id = false], [ $subsection = ''])
 static void setMode (string $mode)
 static object class singleton ()
 static void writeConfig ( &$config,  $config_filename)
 void load ()
 void setLocal (string $file)
 void setMaster (string $file)
Variables
static string $mode = null (line 58)

Config mode/environment

  • access: public
static object $xml (line 67)

SimpleXML root object of merged master/local

  • access: public
Methods
static get (line 284)

Retrieves a config value

Retrieves a value for a config variable. If a mode is set it will attempt to get the value for this variable in the preferred mode. If nothing is found, it will then attempt to retrieve the default value in the local config file and will finally look for the default master value. Note that this method makes use of xpath and adds on the mode criteria

  • return: value or null if not found
  • access: public
mixed get (string $name)
  • string $name: variable path
static getMode (line 140)

Retrieves the current mode

  • access: public
void getMode (string 0)
  • string 0: mode
static getSection (line 323)

Retrieves a config section

Retrieves an array of values for a config section. If a mode is set it will attempt to get the value for these variable in the preferred mode. If nothing is found, it will then attempt to retrieve the default value in the local config file and will finally look for the default master value.

  • return: empty if nothing found
  • access: public
array getSection (string $name, [string $id = false], [ $subsection = ''])
  • string $name: section path
  • string $id: section id when using multiple sections with same name
  • $subsection
static setMode (line 127)

Sets the configuration mode

A mode is set in the config files for each entry in case of multiple entries of the same type that may be used in different environment such as live, dev, debug mode. This mode, which is optional but if given it will be used by the config process to determine which entry to retrieve.

  • access: public
void setMode (string $mode)
  • string $mode: mode
static singleton (line 379)

Returns a class Nexista_singleton.

  • return: Nexista_singleton instance
  • access: public
object class singleton ()
static writeConfig (line 230)

Writes a combined config file for runtime

The master config and optional local config are output as a combined xml file that is used by the runtime system

  • access: public
void writeConfig ( &$config,  $config_filename)
  • &$config
  • $config_filename
load (line 155)

Reads and parses all config data

Reads the master and optional local config file into a common simpleXML object

  • access: public
void load ()
loadMasterConfig (line 199)

Reads the master

  • access: public
void loadMasterConfig ()
returnMasterConfig (line 213)

Return master config simple xml object

  • access: public
void returnMasterConfig ()
setLocal (line 104)

Sets the local override application config data

This method accepts a local config file that can be used to:

  1. override master config settings
  2. create custom settings that can later be accessed in the standard manner

  • access: public
void setLocal (string $file)
  • string $file: path to xml config file
setMaster (line 82)

Sets the master application config data

This method loads the config data that holds the applciation parameters such as paths, location of sitemap, session preferences, db connections, etc... Some of this data will be written directly in the gate files during the compile process.

  • access: public
void setMaster (string $file)
  • string $file: path to xml config file

Documentation generated on Tue, 11 Mar 2008 23:22:55 -0400 for Nexista 0.2.0