sframe/config

config component

dev-master 2014-12-04 13:44 UTC

This package is not auto-updated.

Last update: 2024-04-23 02:05:54 UTC


README

A simple way to load array config in file.

Installation

composer require "sframe/config:dev-master"

Usage

config_path/test.php

return array(
    'a' => 'aaa',
    'b' => array(
        'b1' => '111',
        'b2' => '222'
    )
);

config_path/tt.php

return array(
    'hello' => 'hhhhh'
);

demo.php

$config = new SFrame\Config\FileArray('config_path');
$a = $config->get('test.a');
$b1 = $config->get('test.b.b1');
$hl = $config->get('tt.hello', 'default');
$is_exists = $config->has('test.d');