Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/glynnforrest/speedy-config
No-fuss PHP configuration loader, processor and cache.
https://github.com/glynnforrest/speedy-config
Last synced: 29 days ago
JSON representation
No-fuss PHP configuration loader, processor and cache.
- Host: GitHub
- URL: https://github.com/glynnforrest/speedy-config
- Owner: glynnforrest
- License: mit
- Created: 2016-03-02T03:19:08.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-12-01T10:31:38.000Z (about 7 years ago)
- Last Synced: 2024-12-05T14:48:01.056Z (about 2 months ago)
- Language: PHP
- Size: 28.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Speedy Config
[![Build Status](https://travis-ci.org/glynnforrest/speedy-config.svg?branch=master)](https://travis-ci.org/glynnforrest/speedy-config)
Load configuration from a variety of sources, process and validate it,
then cache the result for speedy loading the next time.## Install
```bash
composer require glynnforrest/speedy-config
```## Usage
Create a config builder with the loaders and processors to use:
```php
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:
```php
$builder->addResource('config.php')
->addResource('config.yml');
```Then get the resolved configuration.
```php
$config = $builder->getConfig();// instance of SpeedyConfig\Config
```