gaw508/config

PHP application configuration library

1.0.1 2016-11-25 06:16 UTC

This package is not auto-updated.

Last update: 2024-04-27 17:42:31 UTC


README

Build Status

A library to manage config key value pairs for PHP applications. Configuration can be loaded from YAML files.

Installation

The latest version can be installed with composer:

composer require gaw508/config

Basic Usage

<?php

require_once 'path/to/vendor/autoload.php';

use Gaw508\Config;

// Load a single YAML config file
Config::loadYaml('config/defaults.yml');

// Load a directory of YAML config files
Config::loadDirectory('config/autoload');

// Use a config value from YAML file
echo Config::get('some_val_from_loaded_file');
// Output: `foo bar`

// Set a single config value
Config::set('my_val', 12);