glynnforrest/speedy-config

No-fuss configuration loader, processor and cache

v0.1.0 2017-04-03 16:02 UTC

This package is not auto-updated.

Last update: 2024-11-09 20:22:55 UTC


README

Build Status

Load configuration from a variety of sources, process and validate it, then cache the result for speedy loading the next time.

Install

composer require glynnforrest/speedy-config

Usage

Create a config builder with the loaders and processors to use:

use SpeedyConfig\ConfigBuilder;
use SpeedyConfig\Loader\YamlLoader;
use SpeedyConfig\Loader\PhpLoader;
use SpeedyConfig\Processor\ReferenceProcessor;

$builder = new ConfigBuilder([new YamlLoader(), new PhpLoader()], new ReferenceProcessor());

Add resources to load:

$builder->addResource('config.php')
    ->addResource('config.yml');

Then get the resolved configuration.

$config = $builder->getConfig();

// instance of SpeedyConfig\Config