ZF-7566: Zend/Application/Bootstrap/Bootstrap.php doesn't include Zend/Application/Bootstrap/BootstrapAbstract.php


Zend/Application/Bootstrap/Bootstrap.php doesn't include Zend/Application/Bootstrap/BootstrapAbstract.php while Zend_Application_Bootstrap_Bootstrap extends Zend_Application_Bootstrap_BootstrapAbstract


include/require must be needed? or can be autoloded?

I guess most Zend/App* files dont have require_once's because Zend_App is dependent on autoloading:

"It also takes care of setting up the PHP environment and introduces autoloading by default."…

Zend_Application_Bootstrap_BootstrapAbstract can be autoloded, so include/require method is not needed.

Zend_App is dependent on autoloading.

You are perfectly right, nevertheless, lazy loading still has an effective cost and should remain the end user's choice.

As far as I'm concerned, I use to load "libraries relations" (for instance: extended class when defining the extension class) using require_once and to use lazy loading when using these classes/libraries.

Autoloading is generally cheaper than calling require_once explicitly, particularly when it comes to library code such as ZF; this is the reason why we recommend stripping require_once calls and enabling autoloading within our performance guide. Leaving require_once statements in leads to issues where multiple files call require_once on the same class file(s) -- leading to a performance decrease due to multiple stat calls being made. (If you don't believe me, do some profiling and benchmarking sometime -- it's eye-opening.)

While I understand your reasons, the fact of the matter was that Zend_Application was designed from the ground up to use autoloading -- the constructor of Zend_Application instantiates autoloading. As such, we chose not to place require_once statements in the various Zend_Application sub-components.