Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The reason modules bootstraps enable autoload is because they extend Zend_Application_Module_Bootstrap which sets the autoloader in the constructor like so</p> <pre><code>public function __construct($application) { //... if ($application-&gt;hasOption('resourceloader')) { $this-&gt;setOptions(array( 'resourceloader' =&gt; $application-&gt;getOption('resourceloader') )); } $this-&gt;initResourceLoader(); //... } </code></pre> <p>This runs because the modules resource runs the bootstrap for each module in the init function ...</p> <pre><code> foreach ($modules as $module =&gt; $moduleDirectory) { $bootstrapClass = $this-&gt;_formatModuleName($module) . '_Bootstrap'; if (!class_exists($bootstrapClass, false)) { $bootstrapPath = dirname($moduleDirectory) . '/Bootstrap.php'; if (file_exists($bootstrapPath)) { $eMsgTpl = 'Bootstrap file found for module "%s" but bootstrap class "%s" not found'; include_once $bootstrapPath; if (($default != $module) &amp;&amp; !class_exists($bootstrapClass, false) ) { throw new Zend_Application_Resource_Exception(sprintf( $eMsgTpl, $module, $bootstrapClass )); } elseif ($default == $module) { if (!class_exists($bootstrapClass, false)) { $bootstrapClass = 'Bootstrap'; if (!class_exists($bootstrapClass, false)) { throw new Zend_Application_Resource_Exception(sprintf( $eMsgTpl, $module, $bootstrapClass )); } } } } else { continue; } } if ($bootstrapClass == $curBootstrapClass) { // If the found bootstrap class matches the one calling this // resource, don't re-execute. continue; } $moduleBootstrap = new $bootstrapClass($bootstrap); $moduleBootstrap-&gt;bootstrap(); $this-&gt;_bootstraps[$module] = $moduleBootstrap; } </code></pre> <p>The short answer is if you don't write the empty bootstrap files, you'll have to abstract some of this well functioning, well tested code into your own global bootstrap file, and then lose the flexibility of having bootstraps for you modules when / if you need to bootstrap them later in your app.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload