class Config (View source)

The Config class.

Properties

static $file The configuration file.
static private $legacy The legacy .json file.

Methods

static 
defaults()

Define default values for all constants that are not overriden.

static 
overrides()

Define constants based on the configuration array.

static array
read()

Read configuration overrides as JSON string form PHP or JSON file and decode the returned string. Note that now the configuration is stored in PHP files instead of JSON files to make it less easy to access from outside.

static 
set(string $name, string $value)

Define constant, if not defined already.

static bool
write(array $config)

Write the configuration file.

Details

static defaults()

Define default values for all constants that are not overriden.

static overrides()

Define constants based on the configuration array.

static array read()

Read configuration overrides as JSON string form PHP or JSON file and decode the returned string. Note that now the configuration is stored in PHP files instead of JSON files to make it less easy to access from outside.

Return Value

array The configuration array

static set(string $name, string $value)

Define constant, if not defined already.

Parameters

string $name
string $value

static bool write(array $config)

Write the configuration file.

Parameters

array $config

Return Value

bool True on success