sframe/config

config 组件

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

This package is not auto-updated.

Last update: 2024-09-24 04:17:46 UTC


README

一种简单的方式,用于将数组配置加载到文件中。

安装

composer require "sframe/config:dev-master"

使用方法

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');