gaw508 / config
PHP application configuration library
1.0.1
2016-11-25 06:16 UTC
Requires
- php: >=5.5.9
- symfony/yaml: ^3.1
Requires (Dev)
- jakub-onderka/php-console-highlighter: ^0.3.2
- jakub-onderka/php-parallel-lint: ^0.9.2
- phpunit/phpunit: ^4.8
- squizlabs/php_codesniffer: ^2.6
This package is not auto-updated.
Last update: 2025-02-01 22:13:58 UTC
README
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);