Avolutions\Config\Config
extends ConfigFileLoaderThe Config class loads all config files at the bootstrapping and can be used to get the config values anywhere in the framework or application.
Properties
Property | Visibility | Type | Description |
---|---|---|---|
$values | protected | array | An array containing all loaded configuration values |
Methods
Method | Visibility | Description |
---|---|---|
__construct() | public | Creates a new Config instance and loads all config values from the config files of core and app. The config values of the core are overridden by app config values. |
get() | public | Returns the value for the given key. The key is separated by slashes (/). |
loadConfigFile() | protected | Loads the given config file and return the content (array) or an empty array if the file can not be found. |
set() | public | Set the value for the given config key. The key is separated by slashes (/). |
Property Details
$values
An array containing all loaded configuration values
protected array<string|int, mixed> $values = []
Method Details
__construct()
Creates a new Config instance and loads all config values from the config files of core and app. The config values of the core are overridden by app config values.
public
__construct(Application $Application) : mixed
Parameters
Application
$Application
Application instance.
get()
Returns the value for the given key. The key is separated by slashes (/).
public
get(string $key) : mixed
Parameters
string
$key
The key (slash separated) of the config value.
Return values
mixed Returns the value for the given key. The key is separated by slashes (/).set()
Set the value for the given config key. The key is separated by slashes (/).
public
set(string $key, mixed $value) : mixed
Parameters
string
$key
The config key (slash separated).
mixed
$value
The value to set.
Return values
mixed Set the value for the given config key. The key is separated by slashes (/).loadConfigFile()
Loads the given config file and return the content (array) or an empty array if the file can not be found.
protected
loadConfigFile(string $configFile) : array<string|int, mixed>
Parameters
string
$configFile
Complete name including the path and file extension of the config file.