Zend_Application_Resource_DbZend_Application_Resource_Db will initialize a
Zend_Db adapter based on the options passed to it. By
default, it also sets the adapter as the default adapter for use with
Zend_Db_Table. If you want to use mutliple databases
simultaneously, you can use the Multidb Resource
Plugin.
The following configuration keys are recognized:
adapter: Zend_Db
adapter type.
params: associative array of configuration
parameters to use when retrieving the adapter instance.
isDefaultTableAdapter: whether or not to
establish this adapter as the default table adapter.
defaultMetadataCache: the name of the
cache template or an instance of Zend_Cache_Core to use as
metadata cache for Zend_Db_Table.
Sample DB adapter resource configuration
Below is an example INI configuration that can be used to initialize
the DB resource.
Retrieving the Adapter instance
If you choose not to make the adapter instantiated with this
resource the default table adapter, how do you retrieve the adapter
instance?
As with any resource plugin, you can fetch the DB resource plugin
from your bootstrap:
getPluginResource('db');
]]>
Once you have the resource object, you can fetch the DB adapter
using the getDbAdapter() method:
getDbAdapter();
]]>