Ver Mensaje Individual
  #3 (permalink)  
Antiguo 28/02/2012, 13:10
david1019
 
Fecha de Ingreso: febrero-2012
Mensajes: 14
Antigüedad: 12 años, 9 meses
Puntos: 1
Respuesta: Zend Framework

Hola masterpuppet

ps la verdad si he leído varios foros pero aun no me funciona la configuración que tengo es la siguiente:

application.ini:

[production]
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
appnamespace = "Application"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.frontController.params.displayExceptions = 0



resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts"

resources.view[] = ""
resources.modules[] = ""


resources.multidb.db1.adapter = "pdo_msql"
resources.multidb.db1.host = "host"
resources.multidb.db1.username = "username"
resources.multidb.db1.password = "password"
resources.multidb.db1.dbname = "tabla"

resources.multidb.db2.adapter = "pdo_mysql"
resources.multidb.db2.host = "host"
resources.multidb.db2.username = "username"
resources.multidb.db2.password = "password"
resources.multidb.db2.dbname = "tabla"


;resources.multidb.db1.isDefaultTableAdapter = true

resources.multidb.db1.isDefaultTableAdapter = true

resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
[staging : production]

[testing : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1

[development : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
resources.frontController.params.displayExceptions = 1

El bootstrap:

protected function _initMyDb() {

$this->bootstrap('multidb');
$resource = $this->getPluginResource('multidb');
$resource->init();

$db1 = $resource->getDb('db1');
$db2 = $resource->getDb('db2');
$defaultDb = $resource->getDb();

Zend_Registry::set('db2', $db2);
Zend_Registry::set('db1', $db1);

}


pero me sale dos tipos de errores el primero es:

Uncaught Ext.Error: Unable to parse the JSON returned by the server: You're trying to decode an invalid JSON String: <br />
<b>Fatal error</b>: Class 'Paramadmin_Model_Rules' not found in <b>C:\AppServ\www\humanintelligence\application\mo dules\paramadmin\controllers\IndexController.php</b> on line <b>21</b><br />

Lo cual tengo entendido que me sale ya que no puede realizar la segunda conexión y trata de convertirme en un objeto toda la cadena de texto

y el siguiente es cuando configuro el boostrap de otra manera como aparece en los doc.

Fatal error: Uncaught exception 'Zend_Application_Resource_Exception' with message 'A DB adapter was tried to retrieve, but was not configured' in C:\ZF\library\Zend\Application\Resource\Multidb.ph p:142 Stack trace: #0 C:\AppServ\www\humanintelligence\application\Boots trap.php(29): Zend_Application_Resource_Multidb->getDb('db1') #1 C:\ZF\library\Zend\Application\Bootstrap\Bootstrap Abstract.php(667): Bootstrap->_initMyDb() #2 C:\ZF\library\Zend\Application\Bootstrap\Bootstrap Abstract.php(620): Zend_Application_Bootstrap_BootstrapAbstract->_executeResource('mydb') #3 C:\ZF\library\Zend\Application\Bootstrap\Bootstrap Abstract.php(584): Zend_Application_Bootstrap_BootstrapAbstract->_bootstrap(NULL) #4 C:\ZF\library\Zend\Application.php(355): Zend_Application_Bootstrap_BootstrapAbstract->bootstrap(NULL) #5 C:\AppServ\www\humanintelligence\public\index.php( 25): Zend_Application->bootstrap() #6 {main} thrown in C:\ZF\library\Zend\Application\Resource\Multidb.ph p on line 142

la verdad agradezco cualquier colaboración...muchas gracias