title: Zend framework 1.12 front controller configuration
body: <p>I am trying to register my modules with the front controller using the bootstrap class by using the code below:</p>
  
  <pre><code>$this-&gt;bootstrap('FrontController');
  $front = $this-&gt;getResource('FrontController');     
  $front-&gt;addModuleDirectory(APPLICATION_PATH."/modules");
  $front-&gt;setParam('prefixDefaultModule', true);
  </code></pre>
  
  <p>This works fine and all the modules are registered. But when I do the following my module directory is not registered and I get the "controller not found error".</p>
  
  <pre><code>$front = Zend_Controller_Front::getInstance();
  $front-&gt;addModuleDirectory(APPLICATION_PATH."/modules");
  $front-&gt;setParam('prefixDefaultModule', true);
  </code></pre>
  
  <p>As the front controller implements the singleton design pattern shouldn't both the code blocks refer to the same instance and both of my code blocks should work? </p>