Class MOXMAN_Util_Config
Inheritance | MOXMAN_Util_Config » MOXMAN_Util_NameValueCollection |
---|---|
Implements | IteratorAggregate |
Configuration utility class to handle config items and extend or expose the items of it.
Protected Properties
Property | Type | Description | Defined By |
---|---|---|---|
$items | array | MOXMAN_Util_NameValueCollection |
Public Methods
Method | Description | Defined By |
---|---|---|
__construct() | Constructs a new Config with the specified array as it's internal items. | MOXMAN_Util_Config |
export() | Exports the config to the public by checking the allow_export property. This property will tell what items is to be expored or now. | MOXMAN_Util_Config |
extend() | Extends the current collection with another collection or array. | MOXMAN_Util_NameValueCollection |
get() | Returns the specified item by name or the default value if it shouldn't be defined in the internal name/value array. | MOXMAN_Util_NameValueCollection |
getAll() | Returns the internal items array. | MOXMAN_Util_NameValueCollection |
getFileConfig() | Returns a new config object based on the specified files path. | MOXMAN_Util_Config |
getGroup() | Returns the specified group as a new name/value array- | MOXMAN_Util_NameValueCollection |
getIterator() | Returns an iterator intance for the internal array. | MOXMAN_Util_NameValueCollection |
put() | Sets the value of a item by name. | MOXMAN_Util_NameValueCollection |
putAll() | Sets the internal items array. | MOXMAN_Util_NameValueCollection |
remove() | Removes a specific key by name. | MOXMAN_Util_NameValueCollection |
replaceVariable() | Replaces the specified variable by name with the specfied value. | MOXMAN_Util_Config |
Method Details
Constructs a new Config with the specified array as it's internal items.
public void __construct ( array $items = [] ) | ||
$items | array | Array with the internal items to set. |
Exports the config to the public by checking the allow_export property. This property will tell what items is to be expored or now.
public Array export ( $groups = "*" ) | ||
$groups | string | Comma separated list of groups to export. |
return | Array | Name/value array with config items that got expored. |
---|
Returns a new config object based on the specified files path.
This will match the file path with the path.overrides in the config.
public MOXMAN_Util_Config getFileConfig ( MOXMAN_Vfs_IFile $file ) | ||
$file | MOXMAN_Vfs_IFile | File to match agains path.overrides. |
return | MOXMAN_Util_Config | New path specific config instance. |
---|
Replaces the specified variable by name with the specfied value.
public void replaceVariable ( $name, $value ) | ||
$name | string | Variable name to replace in config values. |
$value | string | Value for the variable. |