try/json-config

将 .json 文件作为配置读取。

1.0.0 2017-10-23 11:46 UTC

This package is not auto-updated.

Last update: 2024-09-15 04:42:03 UTC


README

.json 文件作为配置读取。

Build Status

安装

$ composer require try/json-config

用法

<?php
require_once '/path/to/autoload.php';

use function TryPhp\jsonConfig;

$config = jsonConfig(__DIR__ . '/some.json');
$somethingNested = $config->get('first_lvl.second_lvl.value');

API

函数

jsonConfig($path)

一个函数,用于加载并返回一个可访问的配置的 .json 文件。(将返回一个 class@anonymous 对象)

参数
返回值

返回对象的 API 描述。

方法
属性

许可证

GPL-2.0 © Willi Eßer