tengo esta configuracion del bottstrap
Código PHP:
date_default_timezone_set('America/Argentina/Buenos_Aires');
set_include_path ( './' . PATH_SEPARATOR .
'../application/default/models/'. PATH_SEPARATOR .
'../application/default/models/beans/'. PATH_SEPARATOR .
'../application/default/views/'. PATH_SEPARATOR .
'../application/default/utils/'. PATH_SEPARATOR .
'../library/'. PATH_SEPARATOR .
'../library/Core/'. PATH_SEPARATOR .
'../library/ZendX/'. PATH_SEPARATOR .
'../application/default/forms/' . PATH_SEPARATOR .
'../application/default/helpers/' . PATH_SEPARATOR .
'../config/' . PATH_SEPARATOR .
get_include_path () );
require_once 'Initializer.php';
require_once "Zend/Loader.php";
Zend_Loader::registerAutoload ();
$frontController = Zend_Controller_Front::getInstance ();
$frontController->registerPlugin ( new Initializer ( 'development' ) );
$frontController->dispatch ();
Código PHP:
public function initDb() {
if ($this->_config->enable_database) {
$fileLogger = Zend_Registry::get ( 'fileLogger' );
$options = array (Zend_Db::AUTO_QUOTE_IDENTIFIERS => true );
print_r($this->getInvokeArg('name'));
try {
$db = new Zend_Db_Adapter_Pdo_Pgsql (
array ('host' => $this->_config->database->host,
'username' => $this->_config->database->user,
'password' => $this->_config->database->pass,
'dbname' => $this->_config->database->name,
'options' => $options ) );
$db->getConnection ();
Zend_Db_Table::setDefaultAdapter ( $db );
Zend_Registry::set ( "database", $db );
} catch ( Zend_Db_Adapter_Exception $e ) {
if ($this->_config->enable_file_logger) {
$fileLogger->log ( 'Database Error: ' . $e->getMessage (), 1 );
}
} catch ( Zend_Exception $e ) {
if ($this->_config->enable_file_logger) {
$fileLogger->log ( 'Error: ' . $e->getMessage (), 1 );
}
}
}
}
es decir en una vista cuando el usuario le de a clic en CBBA seleccione la base de datos de CBBA y cuando le de a STZ seleccione esta base de datos, para ello debo tener los datos necesarios en un array de bases de datos.
ese precisamente es mi problema yo entiendo que zend al hacer Zend_Db_Table::setDefaultAdapter ( $db );
Zend_Registry::set ( "database", $db );
esta poniendo por defecto esa base de datos y que en los modelos se utilizara esta base de datos para las consultas
pero no se como hacerlo estare agradecido por la ayuda prestada