ConfigProvider
A singleton config class.
Tags
Table of Contents
- $configVars : array<string|int, mixed>
- Array to store the config variables.
- $environment : string
- The config environment (dev, pro, test).
- $instance : ConfigProvider
- The config object singleton.
- get() : string
- Get config value.
- getEnvironment() : string
- Get the configuration environment for this application.
- getInstance() : ConfigProvider|ConfigCallbacks
- Get the config object instance.
- reloadConfig() : mixed
- Reloads the config from the relevent .ini file, dependant upon the current environment (hostname).
- set() : mixed
- Set config value.
- __construct() : mixed
- Private constructor means the class cannot be instantiated from elsewhere.
- loadConfig() : mixed
- Loads the config from the relevent .ini file, dependant upon the current environment (hostname).
- setRootPath() : mixed
- Sets the root directory of the application.
Properties
$configVars
Array to store the config variables.
private
array<string|int, mixed>
$configVars
= array()
Tags
$environment
The config environment (dev, pro, test).
private
string
$environment
Tags
$instance
The config object singleton.
private
static ConfigProvider
$instance
Tags
Methods
get()
Get config value.
public
get(string $key) : string
Parameters
- $key : string
-
string
Tags
Return values
string —getEnvironment()
Get the configuration environment for this application.
public
getEnvironment() : string
Tags
Return values
string —getInstance()
Get the config object instance.
public
static getInstance() : ConfigProvider|ConfigCallbacks
Tags
Return values
ConfigProvider|ConfigCallbacks —reloadConfig()
Reloads the config from the relevent .ini file, dependant upon the current environment (hostname).
public
reloadConfig() : mixed
Tags
Return values
mixed —set()
Set config value.
public
set( $key, $val) : mixed
Parameters
Tags
Return values
mixed —__construct()
Private constructor means the class cannot be instantiated from elsewhere.
private
__construct() : mixed
Tags
Return values
mixed —loadConfig()
Loads the config from the relevent .ini file, dependant upon the current environment (hostname).
private
loadConfig() : mixed
Tags
Return values
mixed —setRootPath()
Sets the root directory of the application.
private
setRootPath() : mixed