olegv/config
最新稳定版本:v1.1.1
Composer 安装命令:
composer require olegv/config
包简介
Library for configuration and hiding secret data
README 文档
README
Library for configuration and hiding secret data
Features
- lightweight
- dependency-free
- 100% test coverage
- phpstan max lvl
- phpstan full strict rules
Install
composer require olegv/config
Usage
- Create secret file somewhere(
$path_to_secret_file), it must return array<string, string>, for example:<?php $secret = [ 'very_secret' => 'your_secret_key_here2', ]; return $secret;
- Create file with config array, example:
<?php $config_array = [ 'secret' => $secret['very_secret'], 'not_secret' => [ 'data1', 'data2', 'data3', 'secret' => $secret['very_secret'], ], ]; $config = new Config($path_to_secret_file, $config_array);
- If you need get secret data:
$secret_lvl1 = $config['secret']->getValue(); $secret_lvl2 = $config['not_secret']['secret']->getValue();
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-03-06