zendframework/zend-config-aggregator-parameters

This package is abandoned and no longer maintained. The author suggests using the laminas/laminas-config-aggregator-parameters package instead.

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

Package info

github.com/zendframework/zend-config-aggregator-parameters

pkg:composer/zendframework/zend-config-aggregator-parameters

Statistics

Installs: 16 023

Dependents: 1

Suggesters: 1

Stars: 4

Open Issues: 0

1.2.0 2019-11-22 17:24 UTC

Requires (Dev)

Suggests

None

Provides

None

Conflicts

None

Replaces

None

BSD-3-Clause c2edcabaee88a933020bfdae585277b44ea2c8db

  • Maximilian BΓΆsing <max.woop@boesing.email>

This package is auto-updated.

Last update: 2020-01-29 14:51:33 UTC


README

Repository abandoned 2019-12-31

This repository has moved to laminas/laminas-config-aggregator-parameters.

πŸ‘ Build Status
πŸ‘ Coverage Status

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

Usage

use Zend\ConfigAggregator\ArrayProvider;
use Zend\ConfigAggregator\ConfigAggregator;
use Zend\ConfigAggregatorParameters\ParameterPostProcessor;

$aggregator = new ConfigAggregator(
 [
 new ArrayProvider([
 'parameter_usage' => '%foo%',
 'parameter_name' => '%%foo%%',
 'recursive_parameter_usage' => '%bar.baz%',
 'parameterized_parameter_usage' => '%bar.quux%',
 ]),
 ],
 null,
 [
 new ParameterPostProcessor([
 'foo' => 'bar',
 'bar' => [
 'baz' => 'qoo',
 'quux' => '%foo%', 
 ],
 ]),
 ]
);

var_dump($aggregator->getMergedConfig());

Result:

array(5) {
 'parameter_usage' =>
 string(3) "bar"
 'parameter_name' =>
 string(5) "%foo%"
 'recursive_parameter_usage' =>
 string(3) "qoo"
 'parameterized_parameter_usage' =>
 string(3) "bar"
 'parameters' =>
 array(4) {
 'foo' =>
 string(3) "bar"
 'bar' =>
 array(2) {
 'baz' =>
 string(3) "qoo"
 'quux' =>
 string(3) "bar"
 }
 'bar.baz' =>
 string(3) "qoo"
 'bar.quux' =>
 string(3) "bar"
 }
}

For more details, please refer to the documentation.