Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installation of a symfony2 bundle (DoctrineCouchDBBundle)

I wish to install the bundle into my symfony project. However, I am coming across a few issues. Please accept my ignorance if the answer is trivial but I've tried searching for a solution but alas, I've found nothing.

In my deps file, I have:

[doctrine-couchdb]
  git=http://github.com/doctrine/couchdb-odm.git
[DoctrineCouchDBBundle]
  git=http://github.com/doctrine/DoctrineCouchDBBundle.git
  target=/bundles/Symfony/Bundle/DoctrineCouchDBBundle

I run the bin/vendors install command

In my autoload.php file I have:

'Doctrine\\ODM\\CouchDB'=> __DIR__.'/../vendor/doctrine-couchdb/lib',

I've registered the bundle:

new Doctrine\Bundle\CouchDBBundle\DoctrineCouchDBBundle()

When I run php app/console I get the error:

Fatal error: Class 'Doctrine\Bundle\CouchDBBundle\DoctrineCouchDBBundle' not found in /var/www/symfony2.test/app/AppKernel.php on line 22

I've noticed that for MongoDB ODM you have:

[doctrine-mongodb]
    git=http://github.com/doctrine/mongodb.git

is there not a doctrine-couchdb repo? Have you used this bundle?

like image 758
Flukey Avatar asked Nov 05 '22 18:11

Flukey


1 Answers

I changed target to


    target= /bundles/Doctrine/Bundle/CouchDBBundle

so now looks like this


    [DoctrineCouchDBBundle]
      git=http://github.com/doctrine/DoctrineCouchDBBundle.git
      target=/bundles/Doctrine/Bundle/CouchDBBundle

because I noticed that name space for couchdb bundle is


    namespace Doctrine\Bundle\CouchDBBundle;

therefore adding


    new Doctrine\Bundle\CouchDBBundle\DoctrineCouchDBBundle()

to AppKernel will fail, if installation location does not match namespace/class_name.

Detailed setup and configuration here DoctrineCouchDBBundle Git Hub Issue Log

For those that are new to Symfony 2 bundling architecture, you probably wonder what configuration keys are mandatory and available for bundles. Info can be obtained from:


    bundle_dir/bundle_name/.../configuration.php

like image 115
isawk Avatar answered Nov 09 '22 12:11

isawk