simplydi/simplyconfig

A very simple configuration component for any app using yaml files

dev-main 2023-08-05 07:25 UTC

This package is auto-updated.

Last update: 2024-05-05 09:07:51 UTC


README

A verify simple configuration component using Yaml files

Usage

Your YAML file: settings.yaml

app:
  name: It works
  timezone: UTC

otherConfig: this thing works too

In your app:

// init the class and pass the path to yaml file
$config = new \SimplyDi\SimplyConfig\Config("/path/to/settings.yaml");

// can use dot notation
$appName = $config->get('app.name');

echo $appName; // prints "It works"

echo $config->get('otherConfig'); // prints "this thing works too"