zendframework / zend-config-aggregator-parameters
此包已被废弃,不再维护。作者建议使用laminas/laminas-config-aggregator-parameters包。
为zendframework/zend-config-aggregator提供的后处理器扩展,允许在配置中使用模板参数
1.2.0
2019-11-22 17:24 UTC
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
仓库已废弃于2019-12-31
为zendframework/zend-config-aggregator
提供扩展,允许在配置中使用参数。
用法
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());
结果
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" } }
有关更多详细信息,请参阅文档。