junker/yaml-configuration-service-provider

YAML Configuration Service Provider for Silex

0.2.0 2020-06-18 15:02 UTC

This package is auto-updated.

Last update: 2024-10-19 00:10:51 UTC


README

YAML Configuration Service Provider for Silex

Latest Stable Version Total Downloads Build Status Scrutinizer Code Quality License

Requirements

silex 2.x

Installation

The best way to install YamlConfigurationServiceProvider is to use a Composer:

php composer.phar require junker/yaml-configuration-service-provider

Supports

Examples

use Junker\Silex\Provider\YamlConfigurationServiceProvider;

$app->register(new YamlConfigurationServiceProvider('config.yml'));

# or

$app->register(new YamlConfigurationServiceProvider('config.yml', ['cache_dir' => '/tmp/config_cache']));

$db_host = $app['config']['db']['host'];

Config example:

imports:
     - { resource: 'site/config.yml' }
     - { resource: 'security.yml' }

db:
    host: localhost
    login: root
    pass: 123123
    database: site12

facebook:
    scope: 'public_profile,email,user_birthday,user_location,user_photos'
    secret_key: FDSLKFDNSLsdre23lkndas