AnewtConfig Class Reference

The AnewtConfig class provides static methods for configuration management. More...

List of all members.

Public Member Functions

 __construct ()
 Constructor throws an error.

Static Public Member Functions

static get ($name)
 Return a variable from the configuration data.
static getdefault ($name, $default)
 Return a variable from the configuration data, returning a default value if the value is not available.
static set ($name, $value)
 Store a variable in the configuration data.
static is_set ($name)
 Check if a variable is defined in the configuration data.
static delete ($name)
 Delete a variable from the configuration data.
static seed ($arr)
 Set multiple values at once.
static to_array ()
 Return all configuration data as an array.
static load_ini_file ($filename)
 Load configuration data from a ini file.


Detailed Description

The AnewtConfig class provides static methods for configuration management.

Definition at line 18 of file config.lib.php.


Constructor & Destructor Documentation

AnewtConfig::__construct (  ) 

Constructor throws an error.

Only static usage of this class is allowed.

Definition at line 23 of file config.lib.php.


Member Function Documentation

static AnewtConfig::get ( name  )  [static]

Return a variable from the configuration data.

Parameters:
$name The variable name.
Returns:
The value of the variable.

Definition at line 38 of file config.lib.php.

static AnewtConfig::getdefault ( name,
default 
) [static]

Return a variable from the configuration data, returning a default value if the value is not available.

Parameters:
$name The variable name.
$default The default value returned if the value was not found.
Returns:
The value of the variable.
See also:
array_get_default

Definition at line 61 of file config.lib.php.

static AnewtConfig::set ( name,
value 
) [static]

Store a variable in the configuration data.

Parameters:
$name The variable name.
$value The value of the variable.

Definition at line 76 of file config.lib.php.

static AnewtConfig::is_set ( name  )  [static]

Check if a variable is defined in the configuration data.

Parameters:
$name The variable name to check for.
Returns:
True if the variable is available, false otherwise.

Definition at line 93 of file config.lib.php.

static AnewtConfig::delete ( name  )  [static]

Delete a variable from the configuration data.

Parameters:
$name The name of the variable to delete.

Definition at line 106 of file config.lib.php.

static AnewtConfig::seed ( arr  )  [static]

Set multiple values at once.

Parameters:
$arr An associative array with name/value pairs.
See also:
AnewtConfig::to_array

Definition at line 121 of file config.lib.php.

static AnewtConfig::to_array (  )  [static]

Return all configuration data as an array.

See also:
AnewtConfig::seed

Definition at line 138 of file config.lib.php.

static AnewtConfig::load_ini_file ( filename  )  [static]

Load configuration data from a ini file.

If the ini file contains sections, the name of the configuration settings will be the section name and the setting name with a hyphen in between, e.g. the hostname=... setting inside a [database] setting can be retrieved using AnewtConfig::get('database-hostname').

Parameters:
$filename The filename of the ini file.

Definition at line 156 of file config.lib.php.


The documentation for this class was generated from the following file:

Generated on Sun Aug 2 22:54:37 2009 for Anewt by  doxygen 1.5.9