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: 4 months 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 (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-14T05:45:32.000Z (over 8 years ago)
- Last Synced: 2025-02-19T17:49:16.449Z (5 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
[](https://packagist.org/packages/lezhnev74/dummy-config-loader)
[](https://travis-ci.org/lezhnev74/dummy-config-loader)
[](https://packagist.org/packages/lezhnev74/dummy-config-loader)
[](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]