lezhnev74 / dummy-config-loader
This file allows me to lazy load config files and access entries with dot syntax: `database.default.driver`
Installs: 94
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Type:package
Requires
- php: ^7.0
Requires (Dev)
- phpunit/phpunit: ^6.1
This package is auto-updated.
Last update: 2024-10-29 05:16:19 UTC
README
Usage
$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:
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 lezhnev.work@gmail.com