class Config (View source)

Methods

void
__construct(string $path)

Return items from a config file in a object (iterator or with ->)

static Config
load(string $path)

Create a Negotiation instance

reload()

Reload configuration from file

bool
save()

Reload configuration from file

mixed
get(string $path = null, string $alternative = null)

Get all values like array or get specific item by level (multidimensional) using path

set(string $path, mixed $value)

Set value by path in specific level (multidimensional)

mixed
__get(string $name)

Magic method for get specific item by ->

void
__set(string $name, mixed $value)

Magic method for set value (this method don't save data)

bool
__isset(string $name)

Magic method for check if value exists in top-level

void
__unset(string $name)

Magic method for unset variable with unset() function

Details

void __construct(string $path)

Return items from a config file in a object (iterator or with ->)

Parameters

string $path

Return Value

void

Exceptions

Exception

static Config load(string $path)

Create a Negotiation instance

Parameters

string $path

Return Value

Config

Exceptions

Exception

Config reload()

Reload configuration from file

Return Value

Config

Exceptions

Exception

bool save()

Reload configuration from file

Return Value

bool

mixed get(string $path = null, string $alternative = null)

Get all values like array or get specific item by level (multidimensional) using path

Parameters

string $path (optional) Path with "dots"
string $alternative (optional) alternative value does not find the selected value, default is null

Return Value

mixed

Config set(string $path, mixed $value)

Set value by path in specific level (multidimensional)

Parameters

string $path Path with "dots"
mixed $value Define value

Return Value

Config

mixed __get(string $name)

Magic method for get specific item by ->

Parameters

string $name

Return Value

mixed

void __set(string $name, mixed $value)

Magic method for set value (this method don't save data)

Parameters

string $name
mixed $value

Return Value

void

bool __isset(string $name)

Magic method for check if value exists in top-level

Parameters

string $name

Return Value

bool

void __unset(string $name)

Magic method for unset variable with unset() function

Parameters

string $name

Return Value

void