onlineconf / onlineconf-php
There is no license information available for the latest version (1.0.1) of this package.
Onlineconf client library for php
1.0.1
2023-03-20 09:13 UTC
Requires
- php: >=8.0
- ext-dba: *
- psr/log: ^1.0.1 || ^2.0 || ^3.0
This package is auto-updated.
Last update: 2026-03-27 15:10:49 UTC
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.