linkorb / silex-provider-configloader
Services providing loading of configuration files.
v1.1.1
2017-06-01 05:44 UTC
Requires
- pimple/pimple: ^3.0
- symfony/yaml: ^2.8 || ^3.2
Requires (Dev)
- phpunit/phpunit: ^4.8
Suggests
- symfony/dotenv: To provide the loading of environment variables in a development environment.
This package is auto-updated.
Last update: 2024-10-29 05:04:56 UTC
README
Services providing loading of configuration files.
Two services are provided and registered with a Pimple container:-
config.loader.ini
: loads ini filesconfig.loader.yaml
: loads Yaml files
A third, optional service comfig.loader.env
is registered if the
Symfony Dotenv component is installed.
Install
Install using composer:-
$ composer require linkorb/silex-provider-configloader
and optionally require symfony/dotenv during development:-
$ composer require --dev symfony/dotenv
Then register the provider:-
// app/app.php
use LinkORB\ConfigLoader\Provider\ConfigurationLoaderProvider;
...
$app->register(new ConfigurationLoaderProvider);
Usage
$config = $app['config.loader.ini']->load('path/to/config.ini');