我希望将这个包安装到我的symfony项目中。然而,我遇到了一些问题。请接受我的无知,如果答案是微不足道的,但我已经尝试寻找解决办法,但唉,我什么也没找到。
在我的deps文件中,我有:
[doctrine-couchdb]
git=http://github.com/doctrine/couchdb-odm.git
[DoctrineCouchDBBundle]
git=http://github.com/doctrine/DoctrineCouchDBBundle.git
target=/bundles/Symfony/Bundle/DoctrineCouchDBBundle我运行bin/供应商安装命令
在我的autoload.php文件中有:
'Doctrine\\ODM\\CouchDB'=> __DIR__.'/../vendor/doctrine-couchdb/lib',我登记了包裹:
new Doctrine\Bundle\CouchDBBundle\DoctrineCouchDBBundle()当我运行php app/控制台时,我得到了错误:
Fatal error: Class 'Doctrine\Bundle\CouchDBBundle\DoctrineCouchDBBundle' not found in /var/www/symfony2.test/app/AppKernel.php on line 22我注意到,对于MongoDB ODM,您有:
[doctrine-mongodb]
git=http://github.com/doctrine/mongodb.git难道没有一种学说--couchdb回购吗?你用过这个包裹吗?
发布于 2011-07-14 10:48:20
更新:
1.)检查是否已经安装和自动安装了Doctrine\CouchDB
2.)在你的git安装中
target=/bundles/Symfony/Bundle/DoctrineCouchDBBundle可能应该是
target=/bundles/Doctrine/Bundle/DoctrineCouchDBBundle (通知符号=>原则)
3.)然后改变
'Doctrine' => __DIR__.'/../vendor/doctrine/lib',
至
'Doctrine' => array(__DIR__.'/../vendor/doctrine/lib', __DIR__.'/../vendor/bundles'),
从我的头顶上我可以假设这两件事:
1.)缓存
2. 'Doctrine\\ODM\\CouchDB'=> __DIR__.'/../vendor/doctrine-couchdb/lib',应该高于任何较高级别的名称空间('Doctrine‘、'Doctrine\Common')
所以应该是这样的:
'Doctrine\\ODM\\CouchDB'=> __DIR__.'/../vendor/doctrine-couchdb/lib',
'Doctrine\\DBAL' => __DIR__.'/../vendor/doctrine-dbal/lib',
'Doctrine' => __DIR__.'/../vendor/doctrine/lib',3.)config.yml中缺少的一些配置
https://stackoverflow.com/questions/6691954
复制相似问题