2009年4月26日星期日

Re: AW: [fw-core] Bootstrapping modules with Zend_Application

-- meloniasty <dawid.melewski@gmail.com> wrote
(on Saturday, 25 April 2009, 05:02 AM -0700):
> why in Zend_Application_Resource_Modules all modules are initialized? i
> think it should only initialize only current module, when i run cms module
> its should bootsraping only Cms_Bootstrap and load settings from cms, am i
> right?

There were two considerations in play when we chose to initialize
modules at application bootstrapping time:

* Many people write module-specific routing. The appropriate place to
define this is at the module level -- which means the module
bootstrap must be run at application startup.

* Many people will utilize resources from other modules -- for
instance, to provide widgets to their layouts. For this to work,
autoloading for each module must be setup.

Please be aware, however, that you do not need to use the Modules
resource if it does not fit your needs -- you can always write your own
resource for bootstrapping modules on-demand instead. The resource
provided is intended to fit the 80/20 use case.

--
Matthew Weier O'Phinney
Project Lead | matthew@zend.com
Zend Framework | http://framework.zend.com/

没有评论: