Download the PHP package openlss/lib-config without Composer
On this page you can find all versions of the php package openlss/lib-config. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download openlss/lib-config
More information about openlss/lib-config
Files in openlss/lib-config
Package lib-config
Short Description Configuration access helper and environment manager
License LGPL-3.0+
Homepage http://openlss.org
Informations about the package lib-config
openlss/lib-config
Configuration access helper and environment manager
Usage
Singleton
Config operates with an internal singleton even though all the methods are static.
To retrieve the singleton use the following
Reference
(object) _get()
Returns the current singleton (will create one if it doesnt exist)
(void) setConfig($config)
Will set the passed array to the main config This will merge with the existing config
(void) resetConfig($config)
Resets the internal config registry
(void) dumpConfig($config)
var_dumps the internal config Note: use output buffers to capture this
(void) setDefaults($config)
Made to be used by packages will set the passed config below the internal config Example:
This allows userspace overrides to remain in affect regardless of registration time.
(mixed) set($sec,$name,$value)
Sets a value in the config
- $sec config section (can be an MDA key) NULL for none
- $name config name (can be an MDA key) NULL for none
- $value Value to be set Returns the value to be set
(bool) exists($sec,$name=null)
Check if a value exists
- $sec config section (can be an MDA key) NULL for none
- $name config name (can be an MDA key) NULL for none
(mixed) get($sec=null,$name=null)
Get a value from the confi structure
- $sec config section (can be an MDA key) NULL for none
- $name config name (can be an MDA key) NULL for none
(mixed) getMerged($sec,$name=null)
Get a merged value from the config tree Consider the following config structure
The idea is to retrieve a section from a subroot and gracefully look upstream.
- $sec config section (can be an MDA key) NULL for none
- $name config name (can be an MDA key) NULL for none