API ConfigManager - chsxf/mfx GitHub Wiki
final class ConfigManager implements Services\IConfigServiceConfiguration directives manager, acting as the default configuration service implementation
Since 2.0
public function __construct()Constructor
Since 2.0
public function getValue(string $property, mixed $default = null, ?string $domain = null): mixedGets the value of a configuration property
Since 2.0
| Name | Type | Description |
|---|---|---|
$property |
string |
Path of the property we're trying to get the value of |
$default |
mixed |
Default value if the property has not been found (Defaults to NULL) |
$domain |
`null | string` |
mixed
public function hasValue(string $property, ?string $domain = null): boolDetermines if a configuration property has been provided in the configuration file
Since 2.0
| Name | Type | Description |
|---|---|---|
$property |
string |
Path of the property we're trying to get the value of |
$domain |
`null | string` |
boolean true if the property has been provided, false either
public function load(Config $configData, string $domain = 'self::DEFAULT_DOMAIN')Loads configuration properties
Since 2.0
| Name | Type | Description |
|---|---|---|
$configData |
Config |
Config data |
$domain |
string |
Domain name |
public function tryGetValue(string $property, mixed &$outValue, ?string $domain = null): boolTry getting a value from the currently loaded configuration directives
Since 2.0
| Name | Type | Description |
|---|---|---|
$property |
string |
Path of the property we're trying to get the value of |
$outValue |
mixed |
Output value reference |
$domain |
`null | string` |
bool true if the value exists, false either
| Exception | Reason |
|---|---|
ConfigException |
if the requested domain is not loaded, or the property path or the domain uses invalid syntax |