Configuration Handler

The config is easy.

$this->config is dependent on the context, adjust as neccessary.

/* general usage */
$this->config->getValue([name], [type = 'sys']);
$this->config->setValue([name], [value], [type = 'user']);

/* force a load of a certain config */

/* system config */
$this->config->loadConfig();

/* user config */
$this->config->loadUserConfig();

/* module config */
$this->config->loadModuleConfig();

All configuration values are stored in the database in serialized format and are unserialized when retrieved. This allows you to store any type of variable in the configuration.

loadConfig() loads the system configuration and is automagically run on instantiation.

loadUserConfig() requires a user to be logged in to function properly.

loadModuleConfig() requires that a module be active.

getValue([name], [type = 'sys']) requires a name with an optional type (sys, mod, user) - it defaults to sys. If user is requested it requires a logged in user, if mod is requested it requires an active module.

setValue([name], [value], [type = 'user']) requires a name and a value. The optional type is the same as above. This defaults to user and will only set the user configuration value if a user is logged in. This function will allow any module to set values for other modules and even the system. Use with caution, all references to setValue for config should be verified as non destructive. some type of protective measure should be set so that setValue with a type of 'sys' can only be used from within a particular module... maybe.