class config implements ArrayAccess, IteratorAggregate, Countable
Configuration container class
Methods
__construct(array $config)
Creates a configuration container with a default set of values |
||
ArrayIterator |
getIterator()
Retrieves an ArrayIterator over the configuration values. |
|
bool |
offsetExists(string $key)
Checks if the specified config value exists. |
|
string |
offsetGet(string $key)
Retrieves a configuration value. |
|
offsetSet(string $key, string $value)
Temporarily overwrites the value of a configuration variable. |
||
offsetUnset(string $key)
Called when deleting a configuration value directly, triggers an error. |
||
int |
count()
Retrieves the number of configuration options currently set. |
|
null |
delete(String $key, bool $use_cache = true)
Removes a configuration option |
|
set(string $key, string $value, bool $use_cache = true)
Sets a configuration option's value |
||
bool |
set_atomic(string $key, string $old_value, string $new_value, bool $use_cache = true)
Sets a configuration option's value only if the old_value matches the current configuration value or the configuration value does not exist yet. |
|
increment(string $key, int $increment, bool $use_cache = true)
Increments an integer configuration value. |
Details
at line 32
public
__construct(array $config)
Creates a configuration container with a default set of values
at line 42
public ArrayIterator
getIterator()
Retrieves an ArrayIterator over the configuration values.
at line 53
public bool
offsetExists(string $key)
Checks if the specified config value exists.
at line 64
public string
offsetGet(string $key)
Retrieves a configuration value.
at line 78
public
offsetSet(string $key, string $value)
Temporarily overwrites the value of a configuration variable.
The configuration change will not persist. It will be lost after the request.
at line 88
public
offsetUnset(string $key)
Called when deleting a configuration value directly, triggers an error.
at line 98
public int
count()
Retrieves the number of configuration options currently set.
at line 111
public null
delete(String $key, bool $use_cache = true)
Removes a configuration option
at line 124
public
set(string $key, string $value, bool $use_cache = true)
Sets a configuration option's value
at line 140
public bool
set_atomic(string $key, string $old_value, string $new_value, bool $use_cache = true)
Sets a configuration option's value only if the old_value matches the current configuration value or the configuration value does not exist yet.
at line 158
public
increment(string $key, int $increment, bool $use_cache = true)
Increments an integer configuration value.