Open weierophinney opened 4 years ago
I might need to remove the concept of module name to allow config providers, module instances in a way that would not be annoying or error-prone. It would be rather bad:
$moduleManager = new ModuleManager([
// Include cache configuration
'cache_config' => new ArrayProvider($cacheConfig),
// Framework stuff
\Zend\Mvc\Module::class,
\Zend\Router\Module::class,
// Mvc module that is only providing config can be a regular config provider
'Application' => Application\ConfigProvider::class,
'glob_config' => new PhpFileProvider('config/autoload/{{,*.}global,{,*.}local}.php'),
'dev_config' => new PhpFileProvider('config/development.config.php'),
], $cacheConfig['config_cache_path']);
Eg, if I forgot to specify keys for PhpFileProvider
instances, what would be the module name? Module manager tracks stuff that is already loaded by module name. Result might be... interesting.
Originally posted by @Xerkus at https://github.com/zendframework/zend-modulemanager/issues/79#issuecomment-348745070
I intend to make a prototype for v3 that looks more like a ConfigAggregator hybrid with module manager benefits. I think it will improve the way module manager works with zend-mvc applications that also have console applications, and will make module manager more easily reusable in different contexts.
Module
resolutiongetConfig()
is defined and is callable, then invoke to collect config.Zend\ModuleManager\Feature\*ProviderInterface
.Likely
load modules
event will need to be split intoinit modules
andload modules
. Or most ofload module
listeners moved toload modules post
$config = $moduleManager->getMergedConfig()
roughly doing following:ModuleManagerEventListenersProviderInterface
, attach provided listenersZend\Mvc\Module
:OnBootstrapListener
feature and store them as mvc bootstrap listeners in extra uncacheable configMvcEvent::EVENT_BOOTSTRAP
eventExpected usage is much like with Expressive:
Originally posted by @Xerkus at https://github.com/zendframework/zend-modulemanager/issues/79