ronanchilvers/silex-yaml-config-provider

This package is abandoned and no longer maintained. No replacement package was suggested.

Simple YAML config provider for Silex 1.3+

0.1 2016-01-12 22:20 UTC

This package is auto-updated.

Last update: 2023-09-08 12:54:41 UTC


README

SensioLabsInsight

A very simple YAML config provider for Silex 1.3+ allowing you to read your configuration in from YAML files.

Installation

The easiest mechanism is via composer. Add the provider to your composer.json:

{
    "require": {
        "ronanchilvers/silex-yaml-config-provider": "dev-master"
    }
}

Usage

To register the service provider you can do something like this:

$app->register(new \Ronanchilvers\Silex\Provider\YamlConfigServiceProvider(
    '/path/to/my/yaml/config.yml'
));

You can add the provider multiple times if you want to parse multiple files and the configuration will be merged together.

$app->register(new \Ronanchilvers\Silex\Provider\YamlConfigServiceProvider(
    '/path/to/my/yaml/config.base.yml'
));
$app->register(new \Ronanchilvers\Silex\Provider\YamlConfigServiceProvider(
    '/path/to/my/yaml/config.production.yml'
));

Services Exposed

The YamlConfigServiceProvider exposes the following services.

  • config - The parsed configuration data as an array