-
Notifications
You must be signed in to change notification settings - Fork 0
API ConfigManager
Christophe SAUVEUR edited this page Sep 29, 2024
·
1 revision
final class ConfigManager implements Services\IConfigService
Configuration 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): mixed
Gets 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): bool
Determines 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): bool
Try 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 |
Getting Started | Framework Reference | API Reference | MFX is released under the MIT license