user2605708
user2605708

Reputation: 51

when i run my index file following error occure

When I run my index file following error occure my index file is under
var/www/giftercity/dev/public/index.php

Fatal error: Uncaught exception 'Zend_Application_Bootstrap_Exception' with message 'Resource matching "multidb" not found' in /var/www/Giftercity_backup/dev/library/Zend/Application/Bootstrap/BootstrapAbstract.php:692 
Stack trace: 
#0 /var/www/Giftercity_backup/dev/library/Zend/Application/Bootstrap/BootstrapAbstract.php(627): Zend_Application_Bootstrap_BootstrapAbstract->_executeResource('multidb') 
#1 /var/www/Giftercity_backup/dev/library/Zend/Application/Bootstrap/BootstrapAbstract.php(584): Zend_Application_Bootstrap_BootstrapAbstract->_bootstrap('multidb') 
#2 /var/www/Giftercity_backup/dev/application/Bootstrap.php(336): Zend_Application_Bootstrap_BootstrapAbstract->bootstrap('multidb') 
#3 /var/www/Giftercity_backup/dev/library/Zend/Application/Bootstrap/BootstrapAbstract.php(667): Bootstrap->_initUser() 
#4 /var/www/Giftercity_backup/dev/library/Zend/Application/Bootstrap/BootstrapAbstract.php(620): Zend_Application_Bootstrap_BootstrapAbstract->_executeResource('user') 
#5 /var/www/Giftercity_backup/dev/library/Zend/A in /var/www/Giftercity_backup/dev/library/Zend/Application/Bootstrap/BootstrapAbstract.php on line 692 

Upvotes: 1

Views: 165

Answers (1)

Janis Peisenieks
Janis Peisenieks

Reputation: 4988

As far as I understand from your question, You tried to bootstrap the multidb Resource.

I've personally just done this in my application.ini

    resources.multidb.defaultMetadataCache = "database"

    resources.multidb.db1.adapter = "pdo_mysql"
    resources.multidb.db1.host = "localhost"
    resources.multidb.db1.username = "webuser"
    resources.multidb.db1.password = "XXXX"
    resources.multidb.db1.dbname = "db1"
    resources.multidb.db1.default = true

    resources.multidb.db2.adapter = "pdo_pgsql"
    resources.multidb.db2.host = "example.com"
    resources.multidb.db2.username = "dba"
    resources.multidb.db2.password = "notthatpublic"
    resources.multidb.db2.dbname = "db2"

and then created a function in my bootstrap

protected function _initDb()
{
    $resource = $this->getPluginResource('multidb');
    Zend_Registry::set("multidb", $resource);
} 

There are no more steps involved into bootstrapping multidb, as far as I know.

Upvotes: 1

Related Questions