Skip to content
LaCodon edited this page Dec 16, 2015 · 1 revision

namespace Famework\Config

This class offers a full configuration file handler.

Contents

Relevant public methods

__construct

This is the constructor of Famework_Config.
Throws Famework_Exception_Config_Invalidconfig

$config = new Famework\Config\Famework_Config(string $config);
Parameter Purpose
config The path to a config (.ini) file or the configuration as a string

loadConfig

Loads a new config file or config string.
Throws Famework_Exception_Config_Invalidconfig

void loadConfig(string $config)
Parameter Purpose
config The path to a config (.ini) file or the configuration as a string

getGroup

Returns a config group as an array.

array getGroup(string $name [, $strict = FALSE])
Parameter Purpose
name The name of the config section
strict If this is set to true, a Famework_Exception_Config_Nosuchgroup will get thrown if no such section exists
RETURN key => value pairs of the config section

getByKey

Returns all values with a certain key, no matter in which section they are.

array getByKey(string $searchkey)
Parameter Purpose
searchkey The name to search for
RETURN array(array('value' => x, 'group' => y))

getValue

Returns the value of a certain key in a certain section.

string getValue(string $group, string $key)
Parameter Purpose
group The name of the config section
key The name of the config entry within the given section
RETURN The actual value from the config as string
Clone this wiki locally