muradg / simparse
simple configs parser
0.1
2016-02-29 23:52 UTC
This package is not auto-updated.
Last update: 2024-09-20 19:14:40 UTC
README
##Example
Firstly, we need to create a folder to store configurations. Then, when we initialize the object, the first parameter is passed the directory where the files will be stored configurations. The second parameter, specify a file type. (Default php)
$config = new SimParse\Config('configs', 'php');
When an object is created, we can expand the library by adding your adapters by addAdapter:
$config->addAdapter('serialize', 'SimParse\Adapters\SerializeAdapter')
To get the data from the file, use the function get(). For example, to retrieve data from configs/config.php file we write the following:
[ 'mysql' => [ 'host' => 'default', 'user' => 'default', 'db' => 'default', ] ]
To get the value of db, the code will be as follows:
$config->get('config.mysql.db');