yidemir/config

This package is abandoned and no longer maintained. No replacement package was suggested.

Tiny configuration management in PHP

v1.0 2018-11-13 14:00 UTC

This package is auto-updated.

Last update: 2022-03-13 21:56:54 UTC


README

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