sergiors/config-service-provider

This package is abandoned and no longer maintained. The author suggests using the sergiors/lullaby package instead.

Load yaml, php, directory config to into your container

2.0.0 2016-05-18 20:39 UTC

This package is not auto-updated.

Last update: 2022-02-01 12:52:30 UTC


README

Install

composer require sergiors/config-service-provider

How to use

Let's imagine you want to load the following yaml file:

imports:
    - { resource: config.yml }

twig.options:
    debug: false

db.options:
    driver: ~
    host: ~
    user: ~
    password: ~
    dbname: ~

routing.options:
    paths: %root_dir%/app/routing.yml

In your php file

use Sergiors\Silex\Provider\ConfigServiceProvider;

$app->register(new ConfigServiceProvider(), [
    'config.filenames' => '%root_dir%/config/config_%env%.yml',
    'config.replacements' => [
        'root_dir' => dirname(__DIR__)
    ]
]);

$app['config.initializer']();

Now you can access $app['twig.options']['debug'] and others

License

MIT