Chyrp

Config

Holds all of the configuration variables for the entire site, as well as Module settings.

Summary
Config Holds all of the configuration variables for the entire site, as well as Module settings.
Variables
$yaml Holds all of the YAML settings as a $key => $val array.
Functions
__construct Loads the configuration YAML file.
set Adds or replaces a configuration setting with the given value.
remove Removes a configuration setting.
current Returns a singleton reference to the current configuration.

Variables

$yaml

private $yaml

Holds all of the YAML settings as a $key => $val array.

Functions

__construct

private function __construct()

Loads the configuration YAML file.

set

public function set( $setting,   
$value,   
$overwrite  =  true )

Adds or replaces a configuration setting with the given value.

Parameters

$setting The setting name.
$value The value.
$overwrite If the setting exists and is the same value, should it be overwritten?

remove

public function remove( $setting )

Removes a configuration setting.

Parameters

$setting The name of the variable to remove.

current

public static function & current()

Returns a singleton reference to the current configuration.