2
私のプロジェクトを開始しようとしていたとき、私はfolowingエラーメッセージがあります。"multidbを" プラグイン解決できません
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の(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);
}
}
アプリケーションを.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
...
...
他の同様のプロジェクトで同じメッセージ(「プラグインを解決できません...」)を持っています
ありがとうございました。
でライン41 & 42を置き換えますか? – dbrumann
ZF v1.11.4を使用していますが、私は最新バージョンを使用する必要がありますか? – Salem
最新バージョンへのアップグレードはお勧めですが、おそらく問題の原因ではありません。 '$ this-> bootstrap( 'multidb')'の代わりに '$ this-> hasPluginResource( 'multidb')'を使ってプラグインリソースを調べてみてください。 – dbrumann