yidemir / Config

Tiny configuration management in PHP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Demir Config

Introduction

Tiny configuration management in PHP

Features

  • Tiny size
  • Simple getter and setter methods
  • Array dot notation
  • Helper function

Installation

$ composer require yidemir/config

Test

composer test

Usage

use Demir\Config\Config;

$config = [
  'foo' => 'bar',
  'app' => [
    'name' => 'baz'
  ]
];

new Config($config);

// getter
$foo = Config::get('foo'); // bar
$name = Config::get('app.name'); // baz

// setter
Config::set('foo', 'qux');
Config::set('app.name', 'mux');

// helper
config(['app.name' => 'data']); // setter
config('app.name'); // getter, result: data

About

Tiny configuration management in PHP

License:MIT License


Languages

Language:PHP 100.0%