indgy/config

Simple array config access

0.1.0 2023-01-18 08:47 UTC

This package is auto-updated.

Last update: 2024-11-18 12:39:27 UTC


README

Simple array config access

Install

Install this package via composer:

composer install ignition-studios/config

Usage

Config expects an associative array as the constructor input.

It has one method which will return the value of the specified key.

$config = new Config([
    "api" => [
        "user" => "Alex",
        "pass" => "sEcReT",
    ],
    "theme" => "dark",
]);

$config->get("theme");
<!-- dark -->

$config->get("api");
<!--
[
    "user" => "Alex",
    "pass" => "sEcReT",
]
-->

The get() method will return a default value if the key is not found

$config->get("size", "medium");
<!-- medium -->

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

$ make test

Contributing

Please see CONTRIBUTING for details.

Credits

License

Proprietary

The code in this repository is proprietary, unauthorised reproduction or distribution is forbidden. Written authorisation may only be granted by a Director of Ignition Studios Ltd.