keiii/yaml-config

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

YAML config utilize symfony components (The Config Component and The Yaml Component) to provide symfony like configuration for any application.

0.2.1 2016-09-25 22:11 UTC

This package is not auto-updated.

Last update: 2023-03-15 20:04:49 UTC


README

Build Status

Utilize symfony components (The Config Component and The Yaml Component) to provide symfony like configuration for any application.

Installation

composer require keiii/yaml-config

Config example

# /parameters.yml
parameters:
    db_username: 'root'
    db_password: 'secret'
# /config/config.env.yml
imports:
    - { resource: '../parameters.yml' }

database:
    username: '%db_username%'
    password: '%db_password%'

Usage

<?php

$loader = \KEIII\YamlConfig\Factory::create(
    __DIR__.'/config', // configs path
    ['key' => 'value'], // replacements
    __DIR__.'/var/cache' // cache path or false
);

$config = $loader->load('config.env.yml'); // array