dev-master
9999999-devA super-simple config parser for small projects
MIT
The Requires
- php >=5.5.0
- symfony/yaml >=3.3.1
Wallogit.com
2017 © Pedro Peláez
A super-simple config parser for small projects
A super-simple configuration manager that enables easy integration with YAML based configuration files., (*1)
Pass in the configuration YAML file location and the class will parse it and make its properties avaialble to you, with dot separated levels of nesting, (*2)
Create a new instance of the config class and load in the config, (*3)
config:
database:
host: 127.0.0.1
user: username
password: password
name: db_name
api:
google:
client_id: myclientid
key: xxxxxxxxx
<?php $file = realpath(__DIR__ . '/path/to/file.yml'); $config = new Config($file);
<?php
echo $config->get('path.to.parameter');
<?php
echo $config->get('config.database.host');
// returns 127.0.0.1
echo $config->get('config.api.google.client_id');
// returns 'myclientid'
A super-simple config parser for small projects
MIT