Skip to content

Configuration #331

@thekid

Description

@thekid

Scope of Change

A new Configuration API will replace util.Properties

Rationale

Functionality

File format

Basically an INI file, but typed.

[section]
key="value"    ; A string. Quotes are necessary for strings!
key='value'    ; Another string
power=6100     ; An integer number
factor=1.5     ; A decimal number
switch=off     ; A boolean (on/off/true/false/yes/no)
list=[1, 2, 3] ; A list

API

$c= new Configuration();
$c->load('file.ini');

$c->value('section', 'key');   // string(5) "value"
$c->value('section', 'power'); // int(6100)

$section= $c->section('section');
$section->value('switch');     // false

Security considerations

Speed impact

Dependencies

Related documents

https://madmurphy.github.io/libconfini/html/libconfini.html
https://github.com/graniticio/inifile

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions