muradg / simparse
simple configs parser
Installs: 17
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/muradg/simparse
This package is not auto-updated.
Last update: 2025-10-03 23:56:50 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');