No-fuss PHP configuration loader, processor and cache.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
tests
.gitignore
.travis.yml
LICENSE.md
README.md
composer.json
phpunit.xml.dist

README.md

Speedy Config

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