ultra-lite/config-reader

1.0.0 2017-02-14 01:03 UTC

This package is not auto-updated.

Last update: 2024-09-14 18:36:57 UTC


README

Build Status Scrutinizer Code Quality Latest Stable Version MIT Licence

logo Ultra-Lite Config Reader

一个超轻量级的配置文件解析器。

用法

$configReader = new \UltraLite\ConfigReader\ConfigReader;
$array = $configReader->getConfigArray('/path/to/file.json');

错误处理

如果出现问题,它(仅)抛出一个某种类型的 \UltraLite\ConfigReader\Exception\ConfigReaderException 异常。

支持的文件类型

.json.ini.php 'return array' 文件受到支持。要成为 UltraLite 项目的组成部分,它非常轻量级,但可以扩展以支持其他文件类型。只需实现自己的 \UltraLite\ConfigReader\FileParser 实现。

$customFileParser = new MyXmlFileParser();
$configReader->addFileParser($customFileParser);
$array = $configReader->getConfigArray('/path/to/file.xml');