What is the recommended way to initialize a DB adapter in ZendFramework?

When working with ZendFramework, the recommended way to initialize a DB adapter is by using the configuration settings provided in the application configuration file. This allows for better organization and management of database connections throughout the application.

// Initialize DB adapter in ZendFramework
$config = new Zend_Config_Ini('/path/to/application.ini', 'production');
$dbConfig = $config->resources->db->params;

$dbAdapter = Zend_Db::factory($dbConfig['adapter'], $dbConfig);
Zend_Db_Table_Abstract::setDefaultAdapter($dbAdapter);