Config
in package
The Config generates a list of key/value pairs for use across the application.
The key/values is based on the /config directory. The system uses dot syntax to organize values with a namespace of the file name and a key of the array key. For example if /config/database returns ['port' => 1234], this value can be retrieved as "database.port"
Table of Contents
- $config : array<string|int, mixed>
- The config object that holds all key/value pairs.
- $directory : string
- The parent directory all config files are stored at.
- all() : array<string|int, mixed>
- Returns the entire saved config array.
- fileExists() : bool
- Convenience method to check if a file exists.
- get() : mixed|null
- Returns a saved config value based on the 'filename.key' keyGroup.
- getAll() : array<string|int, mixed>
- Alias of `all` method.
- init() : mixed
Properties
$config
The config object that holds all key/value pairs.
private
static array<string|int, mixed>
$config
= array()
$directory
The parent directory all config files are stored at.
private
static string
$directory
= 'config'
Methods
all()
Returns the entire saved config array.
public
static all() : array<string|int, mixed>
Return values
array<string|int, mixed> —fileExists()
Convenience method to check if a file exists.
public
static fileExists(string $fileName) : bool
Parameters
- $fileName : string
Return values
bool —get()
Returns a saved config value based on the 'filename.key' keyGroup.
public
static get(string $keyGroup) : mixed|null
Parameters
- $keyGroup : string
Return values
mixed|null —getAll()
Alias of `all` method.
public
static getAll() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —init()
public
static init([string $appRoot = __DIR__ ]) : mixed
Parameters
- $appRoot : string = __DIR__