zendframework/zend-config-aggregator-modulemanager

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

Consume zend-mvc modules as configuration providers within zend-config-aggregator.

Package info

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

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

Statistics

Installs: 42 016

Dependents: 1

Suggesters: 1

Stars: 2

Open Issues: 1

1.0.1 2019-06-24 23:57 UTC

Suggests

None

Provides

None

Conflicts

None

Replaces

None

BSD-3-Clause 1cad1a17ce519b664a8f603db66ff3833a02e0bd

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

This package is auto-updated.

Last update: 2020-01-29 14:50:06 UTC


README

Repository abandoned 2019-12-31

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

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

Provides an extension to the zendframework/zend-config-aggregator so zendframework/zend-mvc modules can be parsed into the new config structure, e.g. for zendframework/zend-expressive or other projects.

Usage

use Zend\ConfigAggregator\ConfigAggregator;
use Zend\ConfigAggregatorModuleManager\ZendModuleProvider;
use My\Zend\MvcModule\Module as MyZendMvcModule;

namespace My\Zend\MvcModule
{
 class Module 
 {
 public function getConfig()
 {
 return [
 'service_manager' => [
 'invokables' => [
 Service\MyService::class => Service\MyService::class, 
 ],
 ],
 ];
 }
 }
}

namespace My\Zend\MvcModule\Service {
 class MyService 
 {
 }
}

$aggregator = new ConfigAggregator([
 new ZendModuleProvider(new MyZendMvcModule()),
]);

var_dump($aggregator->getMergedConfig());

Using this provider, the Module class is being parsed for zendframework/zend-modulemanager interfaces or methods. Just the same way as zendframework/zend-mvc does. Therefore, the output of the example would be:

array(1) {
 'dependencies' => 
 array(1) {
 'invokables' =>
 array(1) {
 'My\Zend\MvcModule\Service\MyService' =>
 string(35) "My\Zend\MvcModule\Service\MyService"
 }
 }
}

For more details, please refer to the documentation.