AnewtConfig class

The AnewtConfig class provides static methods for configuration management.

Class Overview

The AnewtConfig class provides static methods for configuration management.

Public Static Methods

static get($name) [static]

Return a variable from the configuration data.

Parameters

$name

The variable name.

Return value

The value of the variable.

static 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.

Return value

The value of the variable.

See also

static set($name, $value) [static]

Store a variable in the configuration data.

Parameters

$name

The variable name.

$value

The value of the variable.

static is_set($name) [static]

Check if a variable is defined in the configuration data.

Parameters

$name

The variable name to check for.

Return value

True if the variable is available, false otherwise.

static delete($name) [static]

Delete a variable from the configuration data.

Parameters

$name

The name of the variable to delete.

static seed($arr) [static]

Set multiple values at once.

Parameters

$arr

An associative array with name/value pairs.

See also

static to_array() [static]

Return all configuration data as an array.

static 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.

Public Methods

__construct()

Constructor throws an error.

Only static usage of this class is allowed.