class Ini extends Config_Abstract implements Iterator, Traversable, ArrayAccess, Countable (View source)

\Yaf\Config\Ini enables developers to store configuration data in a familiar INI format and read them in the application by using nested object property syntax. The INI format is specialized to provide both the ability to have a hierarchy of configuration data keys and inheritance between configuration data sections. Configuration data hierarchies are supported by separating the keys with the dot or period character ("."). A section may extend or inherit from another section by following the section name with a colon character (":") and the name of the section from which data are to be inherited.


Note:

\Yaf\Config\Ini utilizes the ยป parse_ini_file() PHP function. Please review this documentation to be aware of its specific behaviors, which propagate to \Yaf\Config\Ini, such as how the special values of "TRUE", "FALSE", "yes", "no", and "NULL" are handled.

Properties

protected array $_config from  Config_Abstract
protected bool $_readonly from  Config_Abstract

Methods

mixed
get(string $name = null)

No description

set(string $name, mixed $value) deprecated

No description

bool
readonly()

No description

array
toArray()

No description

__get($name = null)

No description

__set($name, $value)

No description

__construct(string $config_file, string $section = null)

No description

__isset(string $name)

No description

int
count()

No description

void
rewind()

No description

mixed
current()

No description

void
next()

No description

bool
valid()

No description

mixed
key()

No description

void
offsetUnset($name) deprecated

No description

mixed
offsetGet($name)

No description

bool
offsetExists($name)

No description

void
offsetSet($name, TValue $value)

No description

Details

mixed get(string $name = null)

No description

Parameters

string $name

Return Value

mixed

See also

Config_Abstract::get

Config_Abstract set(string $name, mixed $value) deprecated

deprecated not_implemented

No description

Parameters

string $name
mixed $value

Return Value

Config_Abstract

See also

Config_Abstract::set

bool readonly()

No description

Return Value

bool

See also

Config_Abstract::readonly

array toArray()

No description

Return Value

array

See also

Config_Abstract::toArray

__get($name = null)

No description

Parameters

$name

See also

Config_Abstract::get

__set($name, $value)

No description

Parameters

$name
$value

See also

Config_Abstract::set

__construct(string $config_file, string $section = null)

No description

Parameters

string $config_file

path to an INI configure file

string $section

which section in that INI file you want to be parsed

Exceptions

TypeError

__isset(string $name)

No description

Parameters

string $name

int count()

No description

Return Value

int

The custom count as an integer.

The return value is cast to an integer.

See also

Countable::count

void rewind()

No description

Return Value

void

Any returned value is ignored.

See also

Iterator::rewind

mixed current()

No description

Return Value

mixed

Can return any type.

See also

Iterator::current

void next()

No description

Return Value

void

Any returned value is ignored.

See also

Iterator::next

bool valid()

No description

Return Value

bool

The return value will be casted to boolean and then evaluated. Returns true on success or false on failure.

See also

Iterator::valid

mixed key()

No description

Return Value

mixed

TKey on success, or null on failure.

See also

Iterator::key

void offsetUnset($name) deprecated

deprecated not_implemented

No description

Parameters

$name

Return Value

void

See also

ArrayAccess::offsetUnset

mixed offsetGet($name)

No description

Parameters

$name

Return Value

mixed

Can return all value types.

See also

ArrayAccess::offsetGet

bool offsetExists($name)

No description

Parameters

$name

Return Value

bool

true on success or false on failure.

The return value will be casted to boolean if non-boolean was returned.

See also

ArrayAccess::offsetExists

void offsetSet($name, TValue $value)

No description

Parameters

$name
TValue $value

The value to set.

Return Value

void

See also

ArrayAccess::offsetSet