title: in Zend instead of application.ini, can i have my configuration store in php file like config.php
body: <p>I am working on a project based on Zend 1.12.  There is a new requirement in which we have to encode all of our files to prevent hacking.  We used ioncube encoder which encode all of the .php file but not application.ini where it store db information username, password, secret key etc. There are two approach :</p>
  
  <p>1) Have configuration reside in .php file such as config.php instead of application.ini</p>
  
  <p>2) have ioncube encode application.ini</p>
  
  <p>With the first approach I found <a href="http://framework.zend.com/manual/1.12/en/zend.config.introduction.html" rel="nofollow">Zend Config Introduction</a>  where you could have configuration store in array. I need a concrete example with setup in Bootstrap.php where it could utilize these configuration.  Right now all of our model extends from Zend_Db_Table_Abstract.  I really want when i migrate all the application.ini db configuration into config.php all the db operation works and there are several instance in front controller make use of $this->applicationOptions.  I hope my putting configuration this will work as well.  Please help</p>
  
  <p>With second approach I did not found much resolution on ioncube be able to encode application.ini</p>
  
  <p>This is my configuration file</p>
  
  <blockquote>
    <p>return $configArray = array(</p>
    
    <blockquote>
  <pre><code>   'db' =&gt; array(
         'adapter' =&gt; 'pdo_mysql',
         'params'  =&gt; array(
             'host'     =&gt; 'localhost',
             'username' =&gt; 'root',
             'password' =&gt; 'root',
             'dbname'   =&gt; 'test'
         )
     )
  );
  </code></pre>
      
      <p>When i do this in Bootstrap.php and it work</p>
      
      <blockquote>
  <pre><code>   $config = new Zend_Config(require APPLICATION_PATH  .'/configs/config.php');
     $db = Zend_Db::factory($config-&gt;db-&gt;adapter,
                            $config-&gt;dv-&gt;params-&gt;toArray());
     $db = Zend_Db::factory($config-&gt;db);        
     Zend_Db_Table::setDefaultAdapter($db);
  </code></pre>
      </blockquote>
    </blockquote>
  </blockquote>
  
  <p>but when i do </p>
  
  <blockquote>
  <pre><code>   protected function _initDatabase(){ 
       $config = new Zend_Config(require APPLICATION_PATH  .'/configs/config.php');
       $resource = $this-&gt;getPluginResource('db');
       var_dump($this-&gt;getPluginResource('db'));  // this will be null. 
  </code></pre>
  </blockquote>
  
  <p>My question is is should i do anything different in configuration so it will mimic resources.db.adapter, resources.db.params.host etc and it will be picking up by the pluginResources or getoptions</p>