stefna/config

轻量级且具有类型安全的配置加载器

1.3.0 2024-03-21 14:29 UTC

This package is auto-updated.

Last update: 2024-09-21 15:33:07 UTC


README

Build Status Latest Version on Packagist Software License

此包是一个以类型安全为首要基石的轻量级配置加载器。

需求

PHP 8.2 或更高版本。

安装

composer require stefna/config

动机

大多数配置加载器都未能为用户提供一种类型安全的方式去使用它们。

它还承诺在首次读取后不可变。

用法

$config = new \Stefna\Config\FileConfig('path-to-php-config.php');
// config file is not read until it's needed

$config->getBool('boolKey');

贡献

我们总是乐意接收错误/安全报告和错误/安全修复。

许可证

MIT 许可证 (MIT)。请参阅许可证文件获取更多信息。