codin / config

基本配置文件加载支持PHP和Json文件

0.1.0 2020-08-22 14:45 UTC

This package is auto-updated.

Last update: 2024-08-28 19:05:12 UTC


README

轻量级配置文件加载器,支持PHP和JSON文件

$ cat path/to/config/foos.php
<?php return ['foo' => 'bar'];

$ cat path/to/config/bars.json
{"bar":"baz"}
$config = Codin\Config\Config::create('path/to/config');
$config->has('foos.foo'); // true
$config->get('foos.foo'); // "bar"
$config->has('bars'); // true
$config->get('bars'); // ['bar' => 'baz']