onlineconf/onlineconf-php
最新稳定版本:1.0.1
Composer 安装命令:
composer require onlineconf/onlineconf-php
包简介
Onlineconf client library for php
README 文档
README
Onlineconf client library for PHP
Simple usage in a code:
$paramsBag = new ConfigBag('myproject');
$password = $paramsBag->get('level1.level2.secret');
Customization:
$paramsBag = new ConfigBag(
'myproject.level1',
'.'
'/',
new Client($myPsrLogger, '/opt/onlineconf/TREE.cdb')
);
$password = $paramsBag->get('level2.secret');
where params in ConfigBag constructor are:
myproject.level1- namespace your params tree in Onlineconf.- path delimiter for addressing param through the tree/- path delimiter configured in your Onlineconf admin- $myPsrLogger - your PSR-compliant application logger
/opt/onlineconf/TREE.cdb- the location of onlineconf database file, which was brought byonlineconf-updateronto your backend.
It's up to you to handle ConfigBag as single instance in your app. Use DependencyInjection or Singleton as a wrapper.
统计信息
- 总下载量: 1.22k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2022-10-08