Search code examples
zend-frameworkzend-db

Unable to resolve plugin "multidb"


when am trying to start my project i have the folowing error message:

Fatal error: Uncaught exception 'Zend_Application_Bootstrap_Exception' with message 'Unable to resolve plugin "multidb"; no corresponding plugin with that name' in C:\xampp\php\PEAR\Zend\Application\Bootstrap\BootstrapAbstract.php:330 

Stack trace:  
#0 C:\xampp\php\PEAR\Zend\Application\Bootstrap\BootstrapAbstract.php(314): Zend_Application_Bootstrap_BootstrapAbstract->getPluginResource('multidb')  
#1 C:\xampp\php\PEAR\Zend\Application\Bootstrap\BootstrapAbstract.php(673): Zend_Application_Bootstrap_BootstrapAbstract->hasPluginResource('multidb')   
#2 C:\xampp\php\PEAR\Zend\Application\Bootstrap\BootstrapAbstract.php(622): Zend_Application_Bootstrap_BootstrapAbstract->_executeResource('multidb')   
#3 C:\xampp\php\PEAR\Zend\Application\Bootstrap\BootstrapAbstract.php(579): Zend_Application_Bootstrap_BootstrapAbstract->_bootstrap('multidb')   
#4 C:\xampp\htdocs\modular_zf\application\Bootstrap.php(41): Zend_Application_Bootstrap_BootstrapAbstract->bootstrap('multidb')   
#5 C:\xampp\php\PEAR\Zend\Application\Bootstrap\BootstrapAbstract in C:\xampp\php\PEAR\Zend\Application\Bootstrap\BootstrapAbstract.php on line 330  

bootstrap.php(from line 39)

protected function _initDatabases()
{
    $this->bootstrap('multidb'); // line 41
    $resource = $this->getPluginResource('multidb');
    $databases = Zend_Registry::get('config')->resources->multidb;
    foreach ($databases as $name => $adapter)
    {
        $db_adapter = $resource->getDb($name);
        Zend_Registry::set($name, $db_adapter);
    }
}

application.ini

[bootstrap] 
...   
...   
;Database settings
resources.multidb.front_db.adapter  = "pdo_mysql"
resources.multidb.front_db.host     = 127.0.0.1
resources.multidb.front_db.username = admin
resources.multidb.front_db.password = admin
resources.multidb.front_db.dbname   = modular_zfdb
resources.multidb.front_db.default  = true
...   
...   

i have excatly the same message ('Unable to resolve plugin...) in an other similar project

thanks.


Solution

  • Replace line 41 & 42 with this

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