Provides an extension to the laminas/laminas-config-aggregator
so laminas/laminas-mvc
modules can be parsed into the new config structure, e.g. for mezzio/mezzio
or other projects.
use Laminas\ConfigAggregator\ConfigAggregator;
use Laminas\ConfigAggregatorModuleManager\LaminasModuleProvider;
use My\Laminas\MvcModule\Module as MyLaminasMvcModule;
namespace My\Laminas\MvcModule
{
class Module
{
public function getConfig()
{
return [
'service_manager' => [
'invokables' => [
Service\MyService::class => Service\MyService::class,
],
],
];
}
}
}
namespace My\Laminas\MvcModule\Service {
class MyService
{
}
}
$aggregator = new ConfigAggregator([
new LaminasModuleProvider(new MyLaminasMvcModule()),
]);
var_dump($aggregator->getMergedConfig());
Using this provider, the Module class is being parsed for laminas/laminas-modulemanager
interfaces or methods.
Just the same way as laminas/laminas-mvc
does. Therefore, the output of the example would be:
array(1) {
'dependencies' =>
array(1) {
'invokables' =>
array(1) {
'My\Laminas\MvcModule\Service\MyService' =>
string(35) "My\Laminas\MvcModule\Service\MyService"
}
}
}
For more details, please refer to the documentation.
- File issues at https://github.com/laminas/laminas-config-aggregator-modulemanager/issues
- Documentation is at https://docs.laminas.dev/laminas-config-aggregator-modulemanager/