zendframework / zend-config-aggregator-parameters
PostProcessor extension for zendframework/zend-config-aggregator to allow usage of templated parameters within your configuration
Installs: 16 022
Dependents: 1
Suggesters: 1
Security: 0
Stars: 4
Watchers: 15
Forks: 3
Open Issues: 0
Requires
- php: ^7.1
- symfony/dependency-injection: ^3.0 || ^4.1.12 || ^5.0
- zendframework/zend-config-aggregator: ^1.1
- zendframework/zend-stdlib: ^3.1
Requires (Dev)
- phpunit/phpunit: ^7.5.17 || ^8.4.3
- zendframework/zend-coding-standard: ~1.0.0
- zendframework/zend-config: ^3.1
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.
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.
- File issues at https://github.com/zendframework/zend-config-aggregator-parameters/issues
- Documentation is at https://docs.zendframework.com/zend-config-aggregator-parameters/