|Last Updated|| ||Ratings|| ||Unique User Downloads|| ||Download Rankings|
|2021-11-07 (9 months ago) || 73%||Total: 241 ||All time: 7,971 This week: 203|
|Collaborate with this project|| ||Author|
This class can read and write configuration values in JSON files.
It can create and read configuration files that store key-values pairs using the JSON format.
The class can also add, update and delete individual configuration values and store them in the JSON configuration file.
FlatConfig is a lightweight flat file configuration management PHP class. It uses JSON and file storage to store configuration data. The code is well commented so here I just provided some basic usage example. For brief description please explore the code <3
*NOTE: Don't forget to protect your configurtion file from direct access!*
Install via composer
composer require mirazmac/flatconfig
How to use this thing?
To use FlatConfig, we need to create an instance first with the path to the configuration file. File will be created automaticly if doesn't exist.
$configFile = __DIR__ .'/config.json';
// Create a new instance
$config = New FlatConfig($configFile);
Add some data
$config->add('comment', 'Hmm! Looking great watson!');
$config->update('name', 'Miraz Mac');
Retrieve the whole config array
Get a single value by its key
$name = $config->get('name');
Thats all folks!
||Applications that use this package
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.