Hold configuration form a specified configuration file.
Methods
Constructs a new instance of WebLab_Config based on a file or an array.
__construct(string | mixed[] $file)
Parameters
$file
stringmixed[]
Exceptions
Returns whether a node exists.
exists(string $path) : boolean
Parameters
$path
string
Returns
boolean
Retrieve data from the configuration tree using a '.' delimited path.
get(string $path, string $return_type, $throwError) : mixed
If the resulting value is another branch in the configuration tree, values will be returned according to the optional $return_type parameter.
All other values will be returned as the types they were interpreted as.
Parameters
$path
string
$return_type
string
$throwError
Exceptions
Returns
mixed
Return the configuration used by the application.
getApplicationConfig() : \WebLab_Config
Static
This function lazy loads the configuration file.
Returns
Set the path to the configuration file, or set the application config to an instance of WebLab_Config.
setApplicationConfig(string | \WebLab_Config $file)
Static
Properties
$_application_config : \WebLab_Config
This location of this configuration file should be set at startup of the application.
Constants
Constant that indicates you want the get function to return the data wrapped in a new instance of WebLab_Config.
CONFIG_WRAP : string
Constant that indicates you want the get function to return the data as an object.
OBJECT : string
Constant that indicates you want the get function to return RAW data.
RAW : string
In the default implementation this will be an array.