zendframework/zend-config-aggregator-parameters

Name: zend-config-aggregator-parameters

Owner: Zend Framework

Description: PostProcessor extension for zendframework/zend-config-aggregator to allow usage of templated parameters within your configuration

Created: 2018-04-04 20:17:14.0

Updated: 2018-04-10 06:59:20.0

Pushed: 2018-05-22 16:23:32.0

Homepage: null

Size: 826

Language: PHP

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

zend-config-aggregator-parameters

Build Status Coverage Status

Provides an extension to the zendframework/zend-config-aggregator to allow parameters within your configuration.

Usage
Zend\ConfigAggregator\ArrayProvider;
Zend\ConfigAggregator\ConfigAggregator;
Zend\ConfigAggregatorParameters\ParameterPostProcessor;

regator = new ConfigAggregator(
[
    new ArrayProvider([
        'parameter_usage' => '%foo%',
        'parameter_name' => '%%foo%%',
        'recursive_parameter_usage' => '%bar.baz%',
    ]),
],
null,
[
    new ParameterPostProcessor([
        'foo' => 'bar',
        'bar' => [
            'baz' => 'qoo',
        ],
    ]),
]


dump($aggregator->getMergedConfig());

Result:

y(3) {
arameter_usage' =>
ring(3) "bar"
arameter_name' =>
ring(5) "%foo%"
ecursive_parameter_usage' =>
ring(3) "qoo"
arameters' =>
ray(3) {
'foo' => 
 string(3) "bar"
'bar' =>
array(1) {
  'baz' =>
  string(3) "qoo"
}
'bar.baz' =>
string(3) "qoo"


For more details, please refer to the documentation.



This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.