Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/unity-framework/Config
Extensible configuration manager for PHP projects that uses dot notation and supports json, ini, array based and many more common formats
https://github.com/unity-framework/Config
config configuration extensible php unity
Last synced: 3 months ago
JSON representation
Extensible configuration manager for PHP projects that uses dot notation and supports json, ini, array based and many more common formats
- Host: GitHub
- URL: https://github.com/unity-framework/Config
- Owner: unity-framework
- License: mit
- Created: 2017-08-02T18:20:23.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-11-12T16:11:36.000Z (over 6 years ago)
- Last Synced: 2024-08-02T05:11:36.353Z (7 months ago)
- Topics: config, configuration, extensible, php, unity
- Language: PHP
- Homepage:
- Size: 217 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Contributing: contributing.md
- License: license.md
Awesome Lists containing this project
README
# Unity/Config
An extensible configuration manager for PHP projects.
**Get started managing your configurations.**
- [Documentation](https://github.com/unity-framework/Config/blob/master/docs/documentation.md)
- [Examples](https://github.com/unity-framework/Config/blob/master/docs/examples.md)## Features
- Array access
- Dot notation access
- Configurations cache
- Auto driver detection
- Runtime modification## Supported drivers
- [INI](#ini)
- [PHP](#php)
- [XML](#xml)
- [YAML](#yaml)
- [jSON](#json)## Installation
composer require unity/config
## Usage
You have the follow configuration file: **configs/db.php** in your project folder containing the bellow configurations:
```php
'root',
'psw' => 'toor',
'db' => 'example',
'host' => 'localhost'
];
```and you want to manage these configurations, thats what you need to do:
```php
setSource('configs')
->build();
```Now, to access a configuration you can use the `$config->get()`, e.g.:
```php
echo $config->get('db.user');
```Or in a more simple way, using array access:
```php
echo $config['db']['user'];
```Both methods will have the same output:
```php
root
```Ask your self, is it easy???
## Contributing
We will be really thankful if you make a fork, make your changes and send a pull request!
## Credits
- [Eleandro Duzentos](https://github.com/e200/) and [contributors](#).
## License
The Unity/Config is licensed under the MIT license. See [license](https://github.com/unity-framework/Config/blob/master/license.md) file for more information.