Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

Examples

Programie edited this page Dec 16, 2014 · 1 revision

Load configuration and read values

use com\selfcoders\jsonconfig\Config;

$config = new Config("/path/to/your/config.json", "/path/to/your/template.json");

$config->getValue("path.to.your.config.value");// Will return the value (if defined in config.json) or the default value from the template

Saving configuration

use com\selfcoders\jsonconfig\Config;

$config = new Config("/path/to/your/config.json", "/path/to/your/template.json");

$config->setValue("path.to.your.config.value", "the new value");// This will set the value to "the new value"

$config->save();// Make sure to save the file
Clone this wiki locally