Library
Class

Library\StaticConfiguration\Config

class Config

Static global configuration object manager

Methods

static void load(string $class_name = null)

static bool loaded()

Check if the configurator is loaded

static void setConfigurator(ConfiguratorInterface $object)

static array getConfigurator()

static void setRegistry(array $registry)

static array getRegistry()

static array getDefaults()

static array getRequired()

static string getInternal(string $name)

static bool validate(array $entries)

Check if a custom Config class defines all required values

static void overload(array $settings)

Overload a config registry

static void set(string $name, mixed $value)

static mixed get(string $name, mixed $default = null)

static mixed getDefault(string $name)

Details

at line 62
static public void load(string $class_name = null)

Parameters

string $class_name

Return Value

void

Exceptions

InvalidArgumentException if no $class_name is defined for the first call
DomainException if class $class_name doesn't implement the ConfiguratorInterface
DomainException if class $class_name doesn't exist

at line 107
static public bool loaded()

Check if the configurator is loaded

Return Value

bool

at line 117
static public void setConfigurator(ConfiguratorInterface $object)

Parameters

ConfiguratorInterface $object

Return Value

void

Exceptions

Exception if the config class do not define all required values

at line 134
static public array getConfigurator()

Return Value

array

at line 143
static public void setRegistry(array $registry)

Parameters

array $registry

Return Value

void

at line 151
static public array getRegistry()

Return Value

array

at line 159
static public array getDefaults()

Return Value

array

at line 167
static public array getRequired()

Return Value

array

at line 176
static public string getInternal(string $name)

Parameters

string $name

Return Value

string

at line 189
static public bool validate(array $entries)

Check if a custom Config class defines all required values

Parameters

array $entries

Return Value

bool

at line 207
static public void overload(array $settings)

Overload a config registry

Parameters

array $settings

Return Value

void

at line 220
static public void set(string $name, mixed $value)

Parameters

string $name
mixed $value

Return Value

void

at line 233
static public mixed get(string $name, mixed $default = null)

Parameters

string $name
mixed $default

Return Value

mixed

at line 246
static public mixed getDefault(string $name)

Parameters

string $name

Return Value

mixed