ConfigArray
extends ArrayObject
in package
Implementation of {@see \ArrayObject} with the addition that values will be fetched from the environment instead from a locally set key.
Tags
Table of Contents
Properties
- $config : array<string|int, mixed>
- $env : array<string|int, mixed>
- As getenv() is quite slow we cache the whole list of environment variables
- $prefix : string
Methods
- __construct() : mixed
- Construct a new Cloudrexx Config array
- exists() : boolean
- get() : mixed
- offsetExists() : mixed
- offsetGet() : string|int|null
- {@inheritDoc} If an matching system environment variable is set, then the value of that environment varible is returned instead. Any set value on this array will have no effect in that case.
- offsetSet() : mixed
- offsetUnset() : mixed
- set() : void
- unset() : void
Properties
$config
protected
array<string|int, mixed>
$config
= []
$env
As getenv() is quite slow we cache the whole list of environment variables
protected
static array<string|int, mixed>
$env
= array()
List of environment variables
$prefix
protected
string
$prefix
= ''
Methods
__construct()
Construct a new Cloudrexx Config array
public
__construct([string $prefix = '' ]) : mixed
Parameters
- $prefix : string = ''
-
Use to set
exists()
public
exists(string $key) : boolean
Parameters
- $key : string
Tags
Return values
booleanget()
public
get(string $key) : mixed
Parameters
- $key : string
Tags
offsetExists()
public
offsetExists(mixed $offset) : mixed
Parameters
- $offset : mixed
Tags
offsetGet()
{@inheritDoc} If an matching system environment variable is set, then the value of that environment varible is returned instead. Any set value on this array will have no effect in that case.
public
offsetGet(mixed $offset) : string|int|null
A matching system environment variable is defined as follows:
Each uppercase character in $offset (which should be in camelCase
notation) is prefixed by an underscore character, before converting the
resulting string all into uppercase and prefixing it with
CLX_
Parameters
- $offset : mixed
Return values
string|int|null —Returned type depends on option identified by $offset
. If $offset
is undefined, then null
is returned. Important: this will change
in the future. Therefore you must not depend on that. Instead use
static::exists() to check for the existance of an option.
offsetSet()
public
offsetSet(mixed $offset, mixed $value) : mixed
Parameters
- $offset : mixed
- $value : mixed
Tags
offsetUnset()
public
offsetUnset(mixed $offset) : mixed
Parameters
- $offset : mixed
Tags
set()
public
set(string $key, mixed $value) : void
Parameters
- $key : string
- $value : mixed
Tags
unset()
public
unset(string $key) : void
Parameters
- $key : string