Issues

ZF2-38: Modules bootstraps continue resources executing

Description

Every module bootstrap after calling bootstrap() method execute application resources registered in broker stack once more.

Main problem not in twice executing (because broker know which resources already registered and don't execute it), but in cause of broker which unknown about resources which goes after config option which starts execute module resource. For example we have next config options:


resources.modules[] =
resources.customresource.test = true

and "customresource" would be executed before module resource shutdown. That's take a problem when "customresource" try to get "modules" resource, and receive empty executed bootstraps stack, because it started before complete executing of "modules".

Cause of it in common broker and next lines:


foreach ($this->getBroker()->getRegisteredPlugins() as $resource) {
    $this->_executeResource($resource);
}

\Zend\Application\AbstractBootstrap.php method _bootstrap()

I have already found and bugfixing proposal sources is ready. Continue with pull request.

Comments

Resolved by commit: 984453a5f5bf44a35bb4571a65dfe45e4f1517c0