Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lezhnev74/dummy-config-loader
Access configuration values from PHP arrays with dot syntax: `database.default.driver`
https://github.com/lezhnev74/dummy-config-loader
configuration php7
Last synced: 18 days ago
JSON representation
Access configuration values from PHP arrays with dot syntax: `database.default.driver`
- Host: GitHub
- URL: https://github.com/lezhnev74/dummy-config-loader
- Owner: lezhnev74
- License: mit
- Created: 2017-04-13T16:13:40.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-14T05:45:32.000Z (almost 8 years ago)
- Last Synced: 2024-12-19T04:35:16.880Z (about 2 months ago)
- Topics: configuration, php7
- Language: PHP
- Homepage:
- Size: 12.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Latest Stable Version](https://poser.pugx.org/lezhnev74/dummy-config-loader/v/stable)](https://packagist.org/packages/lezhnev74/dummy-config-loader)
[![Build Status](https://travis-ci.org/lezhnev74/dummy-config-loader.svg?branch=master)](https://travis-ci.org/lezhnev74/dummy-config-loader)
[![License](https://poser.pugx.org/lezhnev74/dummy-config-loader/license)](https://packagist.org/packages/lezhnev74/dummy-config-loader)
[![Total Downloads](https://poser.pugx.org/lezhnev74/dummy-config-loader/downloads)](https://packagist.org/packages/lezhnev74/dummy-config-loader)# Usage
```php
$config = new DummyConfigLoader\Config(__DIR__); // this will look for config files in this folder
$value = $config->get('database.default.driver', 'mongodb');
```You will get `mariadb` as `$value` if you will place file `database.php` in the given folder with contents:
```php
return [
"default" => [
"driver" => "mariadb"
]
];
```Otherwise you will get `mongodb`.
First section of any key addresses the file within the directory. One level of recursion allowed. If no such file found in the folder - exception will be thrown.
## Installation
```
composer require lezhnev74/dummy-config-loader
```## Support
If you need help - feel comfortable to ping me at [email protected]